摘要:
Symmetry我的思路:开始是想着将所有点都存在set里面,找出对称轴,然后对于每一个点确定其对称点是否存在,但是觉得这样效率似乎太低,就放弃了。后来想到了这样做:将所有点按x坐标进行排序,若x坐标相同,则对于对称轴左边的点按y坐标又小到大排序,右边则相反。这样的话... 阅读全文
摘要:
Foreign Exchangeversion 1(100ms):#include#include#includeusing namespace std;int n;int main(){ while(scanf("%d",&n) && n){ m... 阅读全文
摘要:
Throwing cards away I queue#include#includeusing namespace std;int n;int main(){ while(scanf("%d",&n) && n){ if(n == 1){ //注... 阅读全文
摘要:
Ducci Sequenceversion 1(130ms):#includeusing namespace std;const int maxn = 20;int t,n,a[maxn];int main(){ scanf("%d",&t); while... 阅读全文
摘要:
Alignment of Code#include#include#include#include#includeusing namespace std;const int maxw = 180 + 5;const int maxl = 1000 + 5;int sp... 阅读全文
摘要:
The Letter Carrier's Rounds注意可能有重复的收件人。version 1(20ms):#include#include#include#include#include#includeusing namespace std;const int m... 阅读全文
摘要:
PGA Tour Prize Money 这道题太麻烦了,先放这儿,日后再说。。。#include#include#includeusing namespace std;const int maxn = 150;struct player{ char name[... 阅读全文
摘要:
Urban Elevations书上的思路(离散化):把所有x坐标排序去重,则任意两个相邻x坐标形成的区间具有相同属性,一个区间要么完全可见,要么完全不可见。这样,只需在这个区间里任选一个点(例如中点),就能判断出一个建筑物是否在整个区间内可见。如何判断一个建筑物是否... 阅读全文
摘要:
Database思路:只枚举c1和c2,然后从上到下扫描各行。每次碰到一个新的行r,把c1,c2两列的内容作为一个二元组存到一个map中。如果map的键值中已经存在这个二元组,该二元组映射到的就是所要求的r1,而当前行就是r2。在主循环之前先做一个预处理——给所有字符... 阅读全文
摘要:
Unix ls #include#include#includeusing namespace std;const int len = 60 + 2;void print(const string& s,int len,char extra){ cout>n){... 阅读全文