代码: #include<iostream> #include<cstring> #include<cstdio> #include<cmath> #include<algorithm> using namespace std; int main(){ int a,b,c; int sum; while(~scanf("%d%d%d",&a,&b,&c)){ sum=; )sum++; )sum++;…
前缀和. 代码: 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<cmath> 5 #include<algorithm> 6 using namespace std; 7 typedef long long ll; 8 const int N=5*1e6+10; 9 int a[N]; 10 ll q[N]; 11 ll flag[N]; 12 int…
代码: 1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<cmath> 5 #include<algorithm> 6 using namespace std; 7 const int N=1e4+10; 8 int a[N]; 9 int flag[N]; 10 int main(){ 11 int n,m; 12 while(~scanf("…
Mart Master II Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 675    Accepted Submission(s): 237 Problem Description Trader Dogy lives in city S, which consists of n districts. There are n - 1…
ACM ICPC Central Europe Regional Contest 2013 Jagiellonian University Kraków Problem A: Rubik’s RectangleProblem B: What does the fox say?Problem C: Magical GCDProblem D: SubwayProblem E: EscapeProblem F: DraughtsProblem G: History courseProblem H: C…
Clone Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/65536K (Java/Other) Total Submission(s) : 8   Accepted Submission(s) : 5 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description After eating food from Chernobyl,…
题目链接:http://acm.bnu.edu.cn/bnuoj/problem.php?search=2014+ACM-ICPC+Beijing+Invitational+Programming+Contest 总共十道题, 又结束了一场逗比的比赛, 感觉后半场都在梦游,结果被虐了!!!!大家都虐我一万里啊. 正如wushen说的,“那些被虐过的比赛,唯有赛后AK掉来泄愤.” 本弱太菜,还达不到AK的境界,只能搞出这场的8道题. A A Matrix 一个很神奇的题目,全场就坑在这题了,其实应…
鞍山现场赛结束了呢-- 我们出的是D+E+I三道题-- 吾辈AC掉的是D和I两道,趁着还记得.先在这里写一写我写的两道水题D&I的解题报告吧^_^. D题的意思呢是说星云内有一堆排成一条直线的小行星们,给出每一个小行星所处在的距离 我们须要让小行星距离重心距离的平方和最小 (Σdi^2) (啊细节记忆不太清楚就帮大家简化题意了哦^_^)我们最多能够移动k个小行星.问最优状态下上述平方和最小为多少 首先我们知道.k肯定是须要用满的,反证非k次移动一定不优于k次就可以. 然后就是怎样移动的问题.我们…
题目链接:https://codeforces.com/contest/1090/problem/A A conglomerate consists of n companies. To make managing easier, their owners have decided to merge all companies into one. By law, it is only possible to merge two companies, so the owners plan to s…
为迎接10月17号清华命题的鞍山现场赛 杭电上的题目 Biconnected(hdu4997)     状态压缩DP Rotate(hdu4998)    相对任一点的旋转 Overt(hdu4999)   Clone(hdu5000)   DP Walk(hdu5001)   DP Tree(hdu5002)   Osu!(hdu5003)   热身题 KAMI(hdu5004)   The Ghost Blows Light   USACO ORZ   2013/8/27…