
Codeforces
文章平均质量分 78
Charlie-Pan
这个作者很懒,什么都没留下…
展开
-
Codeforces 1
A. Theatre Square: 题目地址:http://codeforces.com/contest/1/problem/A 题目大意:n*m的长方形用a*a的正方形覆盖,允许超出长方形,问需要几个正方形。 算法讨论:计算长和宽分别需要几个a,相乘即可。 Code: #include #include using原创 2014-04-30 16:23:08 · 746 阅读 · 0 评论 -
Codeforces 2
A. Winner 题目地址:http://codeforces.com/contest/2/problem/A 题目大意:给出每一次比赛的得分情况,问最后得分最高的人。若最后分数相同,则输出分数相同的人中第一个分数不小于最后最高分数的人。 算法讨论:用STL中的map和set维护即可。 Code: #include #i原创 2014-05-04 13:03:27 · 1240 阅读 · 0 评论 -
Codeforces 3
A. Shortest path of the king 题目地址:http://codeforces.com/contest/3/problem/A 题目大意:求8*8的棋盘上一个点到另一个点的最短路径。 算法讨论:优先斜着走,走到同一直线后直着走。 Code: #include #define N 10000 us原创 2014-05-09 21:57:41 · 1191 阅读 · 0 评论 -
Codeforces 4
A. Watermelon 题目地址:http://codeforces.com/contest/4/problem/A 题目大意:给一个数,问它能否分解成2个偶数之和。 算法讨论:见代码。 Code: #include using namespace std; int n; int main(){ scanf("原创 2014-05-10 16:52:58 · 752 阅读 · 0 评论 -
Codeforces 5
A. Chat Server's Outgoing Traffic 题目地址:http://codeforces.com/contest/5/problem/A 题目大意:见原题。 算法讨论:用STL的string和map维护。 Code: #include #include #include #include原创 2014-05-12 15:37:18 · 897 阅读 · 0 评论 -
Codeforces Round #263 (Div.1) B. Appleman and Tree
题目地址:http://codeforces.com/contest/461/problem/B 题目大意:给一棵树,每个点为白色或黑色,切断一些边,使得每个连通块有且仅有一个黑点,问划分方案数。 算法讨论:TreeDP。f[x][0..1]表示x所在连通块有0/1个黑点。设y为x的儿子,则DP方程为f[x][1]=f[x][1]*f[y][0]+f[x][1]*f[y][1]+f[x][0]原创 2014-08-27 09:05:22 · 1501 阅读 · 0 评论 -
Codeforces Round #263 (Div. 1) C. Appleman and a Sheet of Paper
题目地址:http://codeforces.com/contest/461/problem/C 题目大意:见原题。 算法分析:启发式暴力,每次把短的纸带折到长的纸带中,在全局记一个rev标记。注意细节。 Code: #include #include #define N 100000 using namespace std; bool rev; int n,q,beg=1,en原创 2014-08-27 11:04:09 · 1558 阅读 · 0 评论