01 2015 档案

摘要:这个题,三个月前写了一次,当时写道200行的时候,就感觉恶心了,当时感觉再写100行也完不成。 今天拿出这题来重写了,尽量精简代码,结果没想到90行就AC了。精简代码的好处之一便是方便调试,因为细节太多了,把很多相似的内容放在函数中就好了。 看似四个棋子的走法不同,实则有一个共同点:都需要判断棋... 阅读全文
posted @ 2015-01-31 14:12 Popco 阅读(162) 评论(0) 推荐(0)
摘要:There is a mysterious planet called Yaen, whose space is 2-dimensional. There are many beautiful stones on the planet, and the Yaen people love to ... 阅读全文
posted @ 2015-01-29 16:03 Popco 阅读(213) 评论(0) 推荐(0)
摘要:A mobile is a type of kinetic sculpture constructed to take advantage of the principle of equilibrium. It consists of a number of rods, from which ... 阅读全文
posted @ 2015-01-28 00:14 Popco 阅读(201) 评论(0) 推荐(0)
摘要:Play on Words Some of the secret doors contain a very interesting word puzzle. The team of archaeologists has to solve it to open that doors. Becaus... 阅读全文
posted @ 2015-01-27 11:53 Popco 阅读(152) 评论(0) 推荐(0)
摘要:Concurrency Simulator Programs executed concurrently on a uniprocessor system appear to be executed at the same time, but in reality th... 阅读全文
posted @ 2015-01-26 21:49 Popco 阅读(245) 评论(0) 推荐(0)
摘要:最害怕这种下棋的题了,情况特别多,考差细节特别多,当时没做,现在翻过头来再看一下,顺便复习一下基础。 这道题要注意格式,输出统计黑白棋子数的时候,数要占两位。其他都是普通的思路,顺着题目要求即可。 寒假刚刚开始,是提高自我的好时间,希望自己能利用起来。 #include using name... 阅读全文
posted @ 2015-01-26 10:37 Popco 阅读(147) 评论(0) 推荐(0)
摘要:矩形回旋 Description 有一个由 n*m(n是行数,m为列数) 的方格组成的矩形阵列。 现在从左上角开始顺时针旋转走动,遇到矩形边框或者遇到已经过的方格就转向继续,直到走完所有方格。求最后结束点的坐标(横坐标位置从1到m,纵坐标从1到n)。 Input 第一行输入一个数T代... 阅读全文
posted @ 2015-01-20 10:24 Popco 阅读(144) 评论(0) 推荐(0)
摘要://本题用cin超时啊,要用scanf#define _CRT_SECURE_NO_WARNINGS#include #include #include #include #include #include using namespace std;const int maxn = 100000... 阅读全文
posted @ 2015-01-19 12:32 Popco 阅读(130) 评论(0) 推荐(0)
摘要:Problem Description Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he need... 阅读全文
posted @ 2015-01-19 11:58 Popco 阅读(127) 评论(0) 推荐(0)
摘要:Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Inpu... 阅读全文
posted @ 2015-01-19 11:26 Popco 阅读(134) 评论(0) 推荐(0)
摘要:相等的尾数 Time Limit: 1 Sec Memory Limit: 128 MB Description 我们假设有一个整数K,需要你寻找两个自然数M和N(M>N),使得K^M和K^N(1000 using namespace std; int vis[1024]; int m... 阅读全文
posted @ 2015-01-12 21:28 Popco 阅读(181) 评论(0) 推荐(0)
摘要:#include #include #include #include using namespace std;long long int table[1024000];void init(void){ for(long long int i=1; i b) swap(a, b); ... 阅读全文
posted @ 2015-01-05 23:33 Popco 阅读(141) 评论(0) 推荐(0)
摘要:Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 75924 Accepted Subm... 阅读全文
posted @ 2015-01-05 23:07 Popco 阅读(225) 评论(0) 推荐(0)
摘要:Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 9776 Accepted: 6964 Description In the Fibonacci integer seque... 阅读全文
posted @ 2015-01-03 09:00 Popco 阅读(185) 评论(0) 推荐(0)
摘要:#include using namespace std;//一般方法int pow1(int a, int b){ int t = a; b--; while(b--) a *= t; return a;}//普通快速幂int pow2(int a,int... 阅读全文
posted @ 2015-01-02 21:47 Popco 阅读(168) 评论(0) 推荐(0)
摘要:向量叉积有甚多应用,包括求三角形面积,判断线段相交,求多边形面积,判断多边形凹凸性,而且不需要推大量公式,误差较小,非常实用,下面是代码 //向量叉积的应用#include #define EPS 1e-10using namespace std;struct point{ doubl... 阅读全文
posted @ 2015-01-02 12:40 Popco 阅读(460) 评论(0) 推荐(1)
摘要:以前只是研究某两个进制A,B之间的转化,现在推广到任意进制。 其中十进制转为B进制:除B取余,倒序排列 目前的缺点是不能算小数和负数。 #include using namespace std;int toTen(const string & old, const int base){ ... 阅读全文
posted @ 2015-01-02 09:59 Popco 阅读(216) 评论(0) 推荐(0)
摘要:最近打算研究一下基础的算法,就先从二分开始做吧,三种方法 #include using namespace std;const int MAXN = 1024;int num[MAXN];//生成测试数据void init(){ for(int i = 0; i > 1; i... 阅读全文
posted @ 2015-01-02 08:52 Popco 阅读(224) 评论(0) 推荐(0)