摘要:
#include#define REP(i,a,b) for(int i=a;i>T; while(T--){ scanf("%d%d",&n,&L); REP(i,1,n) scanf("%1d",&a[i]); s[0]=0;REP(i,1,n) ...
阅读全文
posted @ 2015-12-12 15:06
__560
阅读(264)
推荐(0)
摘要:
#include#define REP(i,a,b) for(int i=a;i>T; while(T--){ scanf("%d",&n); REP(i,1,n) scanf("%d",&a[i]); if(n==0){ cou...
阅读全文
posted @ 2015-12-10 16:24
__560
阅读(333)
推荐(0)
摘要:
#include#define REP(i,a,b) for(int i=a;iB.is:A.w>n>>m){ REP(i,1,m) scanf("%d%d",&e[i].w,&e[i].is),e[i].id=i; sort(e+1,e+m+1); int...
阅读全文
posted @ 2015-12-10 16:20
__560
阅读(345)
推荐(0)
摘要:
#include#define REP(i,a,b) for(int i=a;i=0;}int solve(int k){ if(n>n,n){ REP(i,1,n) scanf("%d%d%d",&p[i].x,&p[i].y,&p[i].c); int ans=...
阅读全文
posted @ 2015-12-08 14:58
__560
阅读(321)
推荐(0)
摘要:
http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=654&pid=1004#include#define REP(i,a,b) for(int i=a;i G[maxn];ll dfs(int u,int x){ ...
阅读全文
posted @ 2015-12-06 00:14
__560
阅读(223)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=101050#problem/B#include#define REP(i,a,b) for(int i=a;i>T; while(T--){ scanf("%d",&n)...
阅读全文
posted @ 2015-11-30 23:53
__560
阅读(196)
推荐(0)
摘要:
http://codeforces.com/contest/602/problem/B这道题的两种做法,滑窗+线段树查询区间最值:#include#define REP(i,a,b) for(int i=a;i>1; build(a,l,m,rt>1; int res=-...
阅读全文
posted @ 2015-11-30 23:36
__560
阅读(263)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=100977#problem/D#include#define REP(i,a,b) for(int i=a;i>n,n){ REP(i,1,n) rec[i].read(i);...
阅读全文
posted @ 2015-11-30 17:30
__560
阅读(297)
推荐(0)
摘要:
宿舍写代码,电脑没电了。。。fuck。。。为何白天也会断电。。。。
阅读全文
posted @ 2015-11-30 12:23
__560
阅读(213)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=100977#problem/B#include#define REP(i,a,b) for(int i=a;i>n){ if(casen>1) puts(""); ...
阅读全文
posted @ 2015-11-30 12:18
__560
阅读(188)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=100977#problem/A#include#define REP(i,a,b) for(int i=a;ia[x]) x=i; if(x!=m){ if(x!=1) ...
阅读全文
posted @ 2015-11-30 12:17
__560
阅读(190)
推荐(0)
摘要:
http://acm.hust.edu.cn/vjudge/contest/view.action?cid=100977#problem/C#include#define REP(i,a,b) for(int i=a;iusing namespace std;typedef long long ll...
阅读全文
posted @ 2015-11-30 07:14
__560
阅读(241)
推荐(0)
摘要:
uva817 According to Bartjenshttp://acm.hust.edu.cn/vjudge/contest/view.action?cid=100945#problem/C#include#define REP(i,a,b) for(int i=a;iusing namesp...
阅读全文
posted @ 2015-11-29 23:44
__560
阅读(276)
推荐(0)
摘要:
uva11214 Guarding the Chessboardhttp://acm.hust.edu.cn/vjudge/contest/view.action?cid=100945#problem/A#include#define REP(i,a,b) for(int i=a;iusing na...
阅读全文
posted @ 2015-11-29 23:19
__560
阅读(323)
推荐(0)
摘要:
/**有的时候把一个专题的题目开成几场比赛,弄成比赛+补题的形式也许效果会更好点。这样比赛没结束的时候就不会随便搜题解了。不想把时间浪费在宿舍,实验室,教学楼和图书馆的路上。接下来从第八章开始,应该是每一章习题基本必做,例题选择性完成10道以上(恰好是两场比赛).每做完一道题,应该按以下格式写,以加...
阅读全文
posted @ 2015-11-29 19:59
__560
阅读(187)
推荐(0)
摘要:
uva818 Cutting Chainshttp://acm.hust.edu.cn/vjudge/contest/view.action?cid=93788#problem/D#include#define REP(i,a,b) for(int i=a;i G[20];int cnt[1=lin...
阅读全文
posted @ 2015-11-28 14:38
__560
阅读(292)
推荐(0)
摘要:
xdoj1065 Efficent Allocation 动态开点的线段树1065: Efficent Allocation时间限制:8 Sec内存限制:256 MB提交:24解决:3[提交][状态][讨论版]题目描述由于XDOJ评测机的一些奇怪行为,本题时限调整到8s。lx正在写一个内存分配器,支...
阅读全文
posted @ 2015-11-26 12:10
__560
阅读(411)
推荐(0)
摘要:
xdoj1023 IP查询 动态开点的线段树1023: IP查询时间限制:1 Sec内存限制:128 MB提交:3473解决:228[提交][状态][讨论版]题目描述现实生活中,每一个IP段都指向一座城市。为了简化问题,我们将IP段直接看做一个整形数,每座城市也有自己的唯一标识ID,也可以看做一个...
阅读全文
posted @ 2015-11-25 23:34
__560
阅读(876)
推荐(1)
摘要:
搜索专题总结第七章的例题做得差不多了,还有一道枚举二叉树和一道比较难的搜方块的没过,另外有一道火柴的用IDA*水过,并没有过大数据,由于这道可以用dancing links过,所以留着dancing links一坑。接下来总结下这章的收获,首先最重要的当然是不需要判重的高效率的IDA*以及估价函数的...
阅读全文
posted @ 2015-11-23 11:36
__560
阅读(278)
推荐(0)
摘要:
平时不好好刷题还想着打比赛? 今年的目标就是刷完紫书第七章的搜索,第八章的贪心,第九章的dp,然后每次的cf补题尽量补到div2的DE题,如果时间有剩余,就学AC自动机等一些数据结构吧。 第一阶段:紫书ch7-ch9 时间11月末-12月31号 第二阶段:紫书ch10-ch11 时间1月1号-1月3
阅读全文
posted @ 2015-11-19 22:30
__560
阅读(451)
推荐(0)
摘要:
C. Subsequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor the given sequence withndiffer...
阅读全文
posted @ 2015-11-12 17:08
__560
阅读(329)
推荐(0)
摘要:
hdu5534 Partial Tree dp(难)Partial TreeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 374Accepte...
阅读全文
posted @ 2015-11-12 17:06
__560
阅读(284)
推荐(0)
摘要:
1009: Josephus环的复仇时间限制: 1 Sec内存限制: 128 MB提交: 170解决: 15[提交][状态][讨论版]题目描述任给正整数n、k,按下述方法可得排列1,2,……,n的一个置换:将数字1,2,.. .,n环形排列,按顺时针方向从1开始计数;计满K时输出该为之上的数字(并从...
阅读全文
posted @ 2015-11-08 14:41
__560
阅读(400)
推荐(0)
摘要:
D. Happy Tree Partytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBogdan has a birthday today a...
阅读全文
posted @ 2015-11-05 15:16
__560
阅读(295)
推荐(0)
摘要:
hdu5269 ZYB loves Xor I 异或,字典树ZYB loves Xor IAccepts: 142Submissions: 696Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Othe...
阅读全文
posted @ 2015-11-04 23:00
__560
阅读(334)
推荐(0)
摘要:
hdu5536 Chip Factory xor,字典树Chip FactoryTime Limit: 18000/9000 MS (Java/Others)Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 280Acc...
阅读全文
posted @ 2015-11-03 13:38
__560
阅读(720)
推荐(0)
摘要:
codeforces#327 div2这场状态不好有点可惜,题目都不难,而且很好。。A题:水题。#include#define REP(i,a,b) for(int i=a;i>l>>p>>q){ printf("%.5f\n",l*1.0*p/(p+q)); } retu...
阅读全文
posted @ 2015-10-27 04:07
__560
阅读(241)
推荐(0)
摘要:
aoapc第六章 R题 Sculpturehttp://7xjob4.com1.z0.glb.clouddn.com/5e3271c0195996a70363138f9cb82dd5Imagine a box, made of copper plate. Imagine a second one, ...
阅读全文
posted @ 2015-10-20 11:28
__560
阅读(265)
推荐(0)
摘要:
aoapc第六章 V题 Paintballhttp://7xjob4.com1.z0.glb.clouddn.com/ba37417d3e441b0072750dba18f2676dYou are playing paintball on a 1000 × 1000 square field. A ...
阅读全文
posted @ 2015-10-20 11:24
__560
阅读(324)
推荐(0)
摘要:
2015-2016 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred)题目链接:http://codeforces.com/contest/589I题:水题签到。...
阅读全文
posted @ 2015-10-18 21:32
__560
阅读(1089)
推荐(0)
摘要:
codeforces#326(div2)A题:水题。#includeusing namespace std;typedef long long ll;const int maxn=1000100;const int INF=(1>n){ int m=INF,ans=0; ...
阅读全文
posted @ 2015-10-16 09:27
__560
阅读(230)
推荐(0)
摘要:
codeforces#324(div2) E. Anton and Ira 贪心E. Anton and Iratime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard...
阅读全文
posted @ 2015-10-08 16:37
__560
阅读(493)
推荐(0)
摘要:
codeforces#324(div2)A题:水题。没注意10的时候特判WA了一次。#include#define REP(i,a,b) for(int i=a;i>n>>t){ if(t==10){ if(n==1){ puts("...
阅读全文
posted @ 2015-10-07 14:27
__560
阅读(295)
推荐(0)
摘要:
codeforces#323(div2) D. Once Again... 求周期数列的LISD. Once Again...time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutput...
阅读全文
posted @ 2015-10-06 22:57
__560
阅读(393)
推荐(0)
摘要:
bestcoder#58(div2) 1004 树状数组维护逆序数InversionAccepts: 33Submissions: 176Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题...
阅读全文
posted @ 2015-10-06 19:46
__560
阅读(297)
推荐(0)
摘要:
bestcoder#45 1002 求区间的逆序数 树状数组Dylans loves sequenceAccepts: 250Submissions: 806Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Ja...
阅读全文
posted @ 2015-10-06 17:28
__560
阅读(328)
推荐(0)
摘要:
poj2299 Ultra-QuickSort 树状数组求逆序数Ultra-QuickSortTime Limit:7000MSMemory Limit:65536KTotal Submissions:49587Accepted:18153DescriptionIn this problem, y...
阅读全文
posted @ 2015-10-06 17:00
__560
阅读(222)
推荐(0)
摘要:
codeforces#323(div2) C. GCD Table 贪心C. GCD Tabletime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output...
阅读全文
posted @ 2015-10-06 16:18
__560
阅读(305)
推荐(0)
摘要:
bestcoder#58(div2) 1002 LCS 置换LCSAccepts: 127Submissions: 397Time Limit: 6000/3000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述你有两个序...
阅读全文
posted @ 2015-10-06 16:14
__560
阅读(471)
推荐(0)
摘要:
codeforces#321(div2) E. Kefa and Watchtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOne day Kef...
阅读全文
posted @ 2015-09-24 19:20
__560
阅读(361)
推荐(0)