这明明就是给纯C选手的大杀器啊。题意:给你k坐标,表示 X,Y 有值C,有 3种操作1) 交换A,B两行2) 交换A,B两列3) 询问(A,B)的值解题思路:map离散化解题代码:// File Name: 1007.cpp// Author: darkdream// Created Time: 2...
分类:
其他好文 时间:
2014-08-13 00:39:44
阅读次数:
259
被虐了一下午。。离散化,开一个rr[mnx], cc[mnx],初始化为rr[i] = i, cc[i],然后换的时候就换这两个数组就好了。。然后就是不断的lower_bound 1 #include 2 #include 3 #include 4 #include 5 #include 6 #in...
分类:
其他好文 时间:
2014-08-13 00:35:54
阅读次数:
289
Problem Description
There is a forest can be seen as N * M grid. In this forest, there is some magical fruits, These fruits can provide a lot of energy, Each fruit has its location(Xi, Yi) and the ...
分类:
其他好文 时间:
2014-08-12 22:19:04
阅读次数:
488
C - Picture
Time Limit:2000MS Memory Limit:10000KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
A number of rectangular posters, photographs and other pictures of ...
分类:
其他好文 时间:
2014-08-12 22:08:14
阅读次数:
460
解题报告
题意:
求矩形周长和。
思路:
左扫上扫,扫过了。
#include
#include
#include
#include
#include
using namespace std;
struct Seg {
int lx,rx,ly,ry,h,v;
friend bool operator < (Seg a,Seg b)
{
...
分类:
其他好文 时间:
2014-08-12 22:06:34
阅读次数:
243
题目链接:Mayor's posters
题意:按顺序往墙上贴海报,可以重叠,问最后可以看到多少海报。(被覆盖的海报是看不到的)
注意:
因为数据比较大,所以不离散化,肯定爆内存。
还有就是,不能只是单纯的离散化,还要处理好点的边界
举个例子
4
2 10.
2 8
3 6
6 8
8 10
离散化后
2 3 6 8 10
1 2 3 4 5
覆盖掉了
...
分类:
其他好文 时间:
2014-08-12 19:05:54
阅读次数:
228
题目地址:POJ 3277
水题。。稍微处理一下然后用求面积并的方法求即可。
代码如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace std;
#define lson l, mid,...
分类:
其他好文 时间:
2014-08-12 19:03:54
阅读次数:
310
E - 覆盖的面积
Time Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status
Description
给定平面上若干矩形,求出被这些矩形覆盖过至少两次的区域的面积.
Input
输入数据的第一行是一个...
分类:
其他好文 时间:
2014-08-12 19:01:42
阅读次数:
290
基于字典序的组合生成算法2010-12-02 01:22:52|分类: 离散数学 |标签:离散数学排列组合 |举报 |字号大中小订阅 一、 问题描述给定非空集合A,按字典序的方法生成集合A的所有组合。关于字典序的概念,这里不做严格定义,只是做一简单解释。字典序是字符串比较的一种方法。例如两个字符串 ...
分类:
其他好文 时间:
2014-08-12 18:34:44
阅读次数:
228
HDU 4028 The time of a day(动态规划)
题目大意:
有n组测试数据,接下来n和m,n表示n个指针1~n,分别是 k 下回到起点,问你从n个选出任意多个指针,同时停在起点算1天,1天的时间超过m的方案有多少种?
解题思路:
动态规划,状态较分散,所以用Map离散化。...
分类:
其他好文 时间:
2014-08-12 17:11:44
阅读次数:
208