摘要:被输入坑了233333另外感觉我这方法好像不太对的样子。。but找不到数据算了ac了== 1 #include 2 #include 3 #include 4 using namespace std; 5 int up[1005][1005],down[1005][1005],l1[1005][10...
阅读全文
摘要:先用单调上升栈处理左右端点A了,稳稳地O(n)做法 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 stacks,s1; 7 int l[100005],r[100005],a[100005]; 8 int m...
阅读全文
摘要:一开始写了个无脑递归,MLE了。。 1 #include 2 #include 3 #include 4 using namespace std; 5 char s[5005]; 6 int vis[5005][5005],n; 7 int dfs(int l,int r) 8 { 9 if...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 char s1[1005],s2[1005]; 6 int dp[1005][1005]; 7 int main() 8 { 9 int len1,len2,i,j,t;10...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int son[6005],dp[6005][3],father[6005],f[6005][6005],a[6005]; 7 void dfs(int x) ...
阅读全文
摘要:T^T老是把转移方程方向想错 1 #include 2 #include 3 long long dp[75][15][15]; 4 int main() 5 { 6 int n,k,i,j,x,y; 7 long long sum; 8 while (~scanf("%...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #define MOD 1000000007 5 long long x,tmp,s2,n; 6 long long a[105],vis[10005],prime[10005]; 7 void exgcd(long lon...
阅读全文
摘要:1 #include 2 #include 3 #define MOD 1000000007 4 int dp[1005][1005],sum[1005][1005]; 5 char s[1005]; 6 int main() 7 { 8 int len,i,j; 9 while...
阅读全文
摘要:2014年10月27日,于学校,翘了思修课。 随着西安赛区以打铁结束,这一年我的比赛已经全部告终,或者说已经被虐完。 如果大一还可以以年轻为借口,以机会还很多为自己的懒惰为借口,那这个时候,已经没有了任何借口。 西安赛区打得真的很好,没有了侥幸,没有了遗憾,对,实力就是那样。 正赛第一天,通神水题...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 #define eps 1e-9 6 long long sum1[50005],sum2[50005]; 7 int a[50005]; 8 int main() 9 {10 ...
阅读全文
摘要:1 #include 2 #include 3 int x,t[100005],d[100005]; 4 int f[100005][10],a[100005]; 5 int vis[355],prime[355]; 6 void dfs1(int tt,int now,int bei) 7 { ...
阅读全文
摘要:1 #include 2 #include 3 int y[5005]; 4 int num[5005]; 5 char s[15]; 6 int main() 7 { 8 int T,i,j,k,x,u,n,flag,cnt,top,yy,maxx,nn; 9 /...
阅读全文
摘要:1 #include 2 #include 3 int dp[1050][15],a[55][55],x[15],y[15],dist[15][15]; 4 int mabs(int x) 5 { 6 return x>0?x:-x; 7 } 8 int main() 9 {10 ...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 vectorcol[100005]; 7 int cnt,now; 8 int maxv[400010],ans[100005],maxx[40...
阅读全文
摘要:1 void add(int x,int y)2 {3 next[++now]=head[x];4 head[x]=now;5 point[now]=y;6 }
阅读全文
摘要:参加acm第一场区域赛,没有超常发挥,反而比之前预料差了许多。 热身赛是在下午两点半开始,赛前看到全场每队都发了一个紫色气球便猜测B(紫色)水题?题目发下来我竟然感觉C是水题,给一个整数问你8个8能不能各种姿势搞出他?在我沉浸在自己的想法中5min后,杰哥说,B水题!立马刷了榜,开B,因为是热...
阅读全文
摘要:转:还记得2年前的一个晚上,我和一个女孩一起写完了这篇文章。写完后,她哭了,我笑了。然后,她走了,我哭了。2年后,我又找到她,这次,我没有让她走掉,她成了我的新娘。不知道什么时候,开始知道ACM;也不知道什么时候,开始喜欢上ACM。但是,我知道,我喜欢上了,而且不会后悔。我是大一的时候进的学校ACM...
阅读全文
摘要:1 #include 2 #include 3 #include 4 int cnt,prime[50005],vis[50005]; 5 int oula(int k) 6 { 7 if (k==1) return 1; 8 int sqr=(int)sqrt(1.0*k),te...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 mapans; 7 pairmp1[100005]; 8 pairmp2[100005]; 9 int a[100005];10 int gcd(int x,i...
阅读全文
摘要:1 #include 2 #include 3 int a[1000005],minv[1000005],num[1000005],gcdv[1000005]; 4 int gcd(int x,int y) 5 { 6 if (y==0) return x; 7 return gc...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 long long a[1000005],b[1000005],pre[100005],maxv[1000005],from[100000...
阅读全文
摘要:1 #include 2 #include 3 int i,j,k,f,flag,c[300],s[300],t,x[6],y[6],a[6],b[6],mini,cnt; 4 long long temp; 5 int aa,bb,cc,dd1; 6 long long tempx[10],t...
阅读全文
摘要:这是常规的使用线段树超时: 1 #pragma comment(linker, "/STACK:16777216") 2 #include 3 #include 4 long long ans[2][100005]; 5 int next[200005],head[100005],poin...
阅读全文
摘要:1 #include 2 #include 3 int now,cnt,d[100005][5]; 4 int next[100005],head[100005],point[100005]; 5 int son[100005],father[100005],num[100005],de...
阅读全文
摘要:1 #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include 3 #include 4 int now,cnt,d[50005][5]; 5 int next[100005],head[50005],point[...
阅读全文
摘要:1 #pragma comment(linker, "/STACK:1024000000,1024000000") 2 #include 3 #include 4 int now,cnt,n,a[50005]; 5 int next[100005],head[50005],point[1...
阅读全文