2013年8月9日

HDU 4399 Query multiset 解法

摘要: 网上看到的multiset解法。就是把每个不同的位置放到multiset里面,然后查询的时候找到比他大的第一个数 即lower_bound(); 更新的是在集合里面插入和删除就行了 。不知道为什么用的multiset ,位置是没有重复的啊 然后换成 set后也可以AC。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 using namespace std;10 11 #define SI(a) scanf("%d", &(a))12 #define S 阅读全文

posted @ 2013-08-09 15:01 zhaosdfa 阅读(181) 评论(0) 推荐(0) 编辑

2013年8月3日

UVA 11520 Fill the Square

摘要: 第一篇题解题意:一个n*n的网格里面填了些大写字母,把剩下的也填上,使得相邻的两个网格不相同,并且从左到右,从上到下连起来的字典序最小。直接对每一个没填的网格依次考虑A到Z是否可以。 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 8 const int maxn = 10 + 5; 9 const int dx[] = {-1, 0, 0, 1};10 const int dy[] = {0, -1, 1, 0};11 char A[maxn][maxn];12 13 14 int ma... 阅读全文

posted @ 2013-08-03 21:23 zhaosdfa 阅读(175) 评论(0) 推荐(0) 编辑

2013年7月16日

test

摘要: test#include int main() { printf("Hello world!\n"); return 0;} 阅读全文

posted @ 2013-07-16 19:52 zhaosdfa 阅读(115) 评论(0) 推荐(0) 编辑

导航