12 2015 档案
摘要:http://codeforces.com/contest/581/problem/F#include#define REP(i,a,b) for(int i=a;i G[maxn];int dp[maxn][maxn][2];int rt;int cnt[maxn];int f[maxn][max...
阅读全文
摘要:这场比赛真是。。。涨分场又打成了掉分场。。。唯一的收获就是理解了扫描线,以前放弃的,现在还是得学,要是之前学了,这场D就能过了。A题:#include#define REP(i,a,b) for(int i=a;i=b;i--)#define MS0(a) memset(a,0,sizeof(a))...
阅读全文
摘要:Black JackAccepts: 0Submissions: 61Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)问题描述21点又名黑杰克(英文:Blackjack),起源于法国,已流传...
阅读全文
摘要:hdu5550 Game Rooms dp调了一下午的bug终于过了。。。思路是没错的,但是由于用了刷表法思考,所以只考虑刷表之后的状态,没有注意刷表前的最初状态,于是调了一下午的bug终于找出来了。。。dp[i][j][k] 表示 前i个,最后一个k的位置为j ( k取0,1,j#define R...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>m>>n){ if(m==0) break; REP(i,1,m) REP(j,1,n) scanf("%d",&a[j][i]); /* REP(i,1,m){...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>n){ REP(i,1,n) scanf("%d%d",&p[i].x,&p[i].y); REP(i,1,n) REP(j,1,n) dp[i][j]=INF*1.0; dp...
阅读全文
摘要:这场要是算分的话估计就有机会涨到紫了,4个题1A。A题:#include#define REP(i,a,b) for(int i=a;i>n>>m){ REP(i,1,n) scanf("%d",&a[i]); sort(a+1,a+n+1); int an...
阅读全文
摘要://#include#include#include#include#include#include#define REP(i,a,b) for(int i=a;i>n){ REP(i,1,n) scanf("%lld",&a[i]); s[0]=0;REP(i,1,n)...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i q;int main(){ freopen("in.txt","r",stdin); while(cin>>n>>d,n||d){ REP(i,1,n) scanf("%1d",&a[i]);...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>T; int casen=1; while(T--){ scanf("%s%s",s,t); len=strlen(s); c10=c01=c1=c0=0; ...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>n,n){ MS0(id1);MS0(id2); int st=1; REP(i,1,n) scanf("%d",&a[i]); int ans=INF; ...
阅读全文
摘要:看似简单的所谓坑题,其实不坑,只是需要细致周密的考虑以及造数据debug的能力,而这正是acmer必备的素质。显然我还不是合格的acmer...这题卡了我好几天。。。#include#define REP(i,a,b) for(int i=a;i>n,n){ REP(i,1,n) ci...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i=1;i--){ R[i]=max(R[i+1],p[i]); R[i]=min(R[i],s[i]); } REP(i,1,n) d[i]=min(L[i],R[i]); ...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i pos;bool judge(int l,int r){ if(l>=r) return 1; //coutr){ nex=li;break; } ...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>T; while(T--){ scanf("%d%d",&s,&n); REP(i,1,n) scanf("%d",&x[i]); MS0(cnt);MS0(m); ...
阅读全文
摘要:2015.12.12 bestcoder的一道数位dp: http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=659&pid=1003 2015.12.20 codeforces的两道没看懂题意的题 http://c
阅读全文
摘要:1002:这题拿两个优先队列维护一下就可以了,近期都在做这种题,然而这题居然还是不会,why am i so stupid...#include#define REP(i,a,b) for(int i=a;i>T; while(T--){ scanf("%d%d",&n,&m);...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i>T;int casen=1; while(T--){ scanf("%d",&n); REP(i,0,n-1) scanf("%lld",&p[i]); REP(i,0,...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i=(1LL>T;int casen=1; s[0]=1;REP(i,1,32) s[i]=s[i-1]*3; while(T--){ scanf("%lld%lld%lld",&k,&a,&b)...
阅读全文
摘要:#include#define REP(i,a,b) for(int i=a;i=1;i--){ s+=a[i]; if(s>m){ s=a[i]; tmp[i]=1; cnt++; } ...
阅读全文
摘要:#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) ...
阅读全文
摘要:#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...
阅读全文
摘要:#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...
阅读全文
摘要:#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=...
阅读全文
摘要: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){ ...
阅读全文

浙公网安备 33010602011771号