Rank:56/147.

开场看B,是个线段树区间合并,花了2hour敲完代码。。。再花了30min查错。。发现push_down有问题。改了就AC了。

然后发现A过了很多人。推了个公式,发现是个分段函数。取个中间点代进去结果就AC了。

C好像也很水?看了看原来是个傻逼BFS。A了。

F化解了一下就 集合子集异或为0的种数。想了想没想到什么东西就go die了。

A.Liang Guo Sha(阅读理解)

看懂题意后搞出两个式子,然后取个极值就行了。

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. int main ()
  45. {
  46. int a, b, c;
  47. while (~scanf("%d%d%d",&a,&b,&c)){
  48. double p=((b+c)*1.0)/(a+b+*c);
  49. double ans=a*p*p+b*(-p)*(-p)-c*(-p)*p*;
  50. printf("%.6f\n",ans);
  51. }
  52. return ;
  53. }

B.Black And White(线段树)

询问区间[l,r]的最长连续黑色的长度。

建立线段树,对每个节点维护6个量,分别表示最长连续黑色,最长连续白色,左边最长连续黑色,左边最长连续白色,右边最长连续黑色,右边最长连续白色。

对于修改操作用tag标记一下。在需要push_down的时候push_down即可AC。

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. struct SegTree{int lbmax, lwmax, rbmax, rwmax, bmax, wmax;}seg[N<<];
  45. struct Node{
  46. int lmax, rmax, ma, siz;
  47. Node(int _lmax=, int _rmax=, int _ma=, int _siz=):lmax(_lmax), rmax(_rmax), ma(_ma), siz(_siz){}
  48. };
  49. int a[N];
  50. bool tag[N<<];
  51.  
  52. void push_up(int p, int l, int r){
  53. int lsize=(l+r)/-l+, rsize=r-(l+r)/;
  54. if (seg[p<<].lbmax) {
  55. seg[p].lbmax=(seg[p<<].lbmax==lsize?seg[p<<|].lbmax:)+seg[p<<].lbmax;
  56. seg[p].lwmax=;
  57. }
  58. else {
  59. seg[p].lwmax=(seg[p<<].lwmax==lsize?seg[p<<|].lwmax:)+seg[p<<].lwmax;
  60. seg[p].lbmax=;
  61. }
  62. if (seg[p<<|].rbmax) {
  63. seg[p].rbmax=(seg[p<<|].rbmax==rsize?seg[p<<].rbmax:)+seg[p<<|].rbmax;
  64. seg[p].rwmax=;
  65. }
  66. else {
  67. seg[p].rwmax=(seg[p<<|].rwmax==rsize?seg[p<<].rwmax:)+seg[p<<|].rwmax;
  68. seg[p].rbmax=;
  69. }
  70. seg[p].bmax=max(max(seg[p<<].bmax,seg[p<<|].bmax),seg[p<<].rbmax+seg[p<<|].lbmax);
  71. seg[p].wmax=max(max(seg[p<<].wmax,seg[p<<|].wmax),seg[p<<].rwmax+seg[p<<|].lwmax);
  72. }
  73. void push_down(int p){
  74. if (!tag[p]) return ;
  75. tag[p<<]^=; tag[p<<|]^=; tag[p]=;
  76. swap(seg[p].bmax,seg[p].wmax); swap(seg[p].lbmax,seg[p].lwmax); swap(seg[p].rbmax,seg[p].rwmax);
  77. }
  78. void init(int p, int l, int r){
  79. if (l<r) {
  80. int mid=(l+r)>>;
  81. init(lch); init(rch); push_up(p,l,r); tag[p]=;
  82. }
  83. else {
  84. if (a[l]) seg[p].lbmax=seg[p].rbmax=seg[p].bmax=, seg[p].lwmax=seg[p].rwmax=seg[p].wmax=;
  85. else seg[p].lwmax=seg[p].rwmax=seg[p].wmax=, seg[p].lbmax=seg[p].rbmax=seg[p].bmax=;
  86. tag[p]=;
  87. }
  88. }
  89. void update(int p, int l, int r, int L, int R){
  90. push_down(p);
  91. if (L>r||R<l) return ;
  92. if (L<=l&&R>=r) tag[p]=, push_down(p);
  93. else {
  94. int mid=(l+r)>>;
  95. update(lch,L,R); update(rch,L,R); push_up(p,l,r);
  96. }
  97. }
  98. Node query(int p, int l, int r, int L, int R){
  99. push_down(p);
  100. if (L>r||R<l) return Node(,,,);
  101. if (L<=l&&R>=r) return Node(seg[p].lbmax,seg[p].rbmax,seg[p].bmax,r-l+);
  102. int mid=(l+r)>>;
  103. Node x=query(lch,L,R), y=query(rch,L,R), z;
  104. z.lmax=(x.lmax==x.siz?y.lmax:)+x.lmax; z.rmax=(y.rmax==y.siz?x.rmax:)+y.rmax;
  105. z.ma=max(max(x.ma,y.ma),x.rmax+y.lmax); z.siz=x.siz+y.siz;
  106. return z;
  107. }
  108. int main ()
  109. {
  110. int n, m, flag, l, r;
  111. while (~scanf("%d",&n)) {
  112. FOR(i,,n) scanf("%d",a+i);
  113. init(,,n);
  114. scanf("%d",&m);
  115. FOR(i,,m) {
  116. scanf("%d%d%d",&flag,&l,&r);
  117. if (flag) update(,,n,l,r);
  118. else {
  119. printf("%d\n",query(,,n,l,r).ma);
  120. }
  121. }
  122. }
  123. return ;
  124. }

C.Turn Right(BFS)

题目保证一定存在起点到终点的路径。如果把终点给封死,那么从起点bfs一次再回到起点就行了。沿途统计所有标记。

这题的节点状态与普通的不同,需要定义vis[i][j]表示到点i是以j方向到的。然后对于每个方向会有一个优先级。即总是turn right。

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. int vis[N][N][], row[N][N], col[N][N];
  45. int ps[][]={{,,,},{,,,},{,,,},{,,,}};
  46.  
  47. struct Node{
  48. int x, y, pos;
  49. Node(int _x=, int _y=, int _pos=):x(_x),y(_y),pos(_pos){}
  50. };
  51. queue<Node>Q;
  52.  
  53. int main ()
  54. {
  55. int T, n, m, s, t;
  56. scanf("%d",&T);
  57. while (T--) {
  58. int num=;
  59. mem(vis,);
  60. scanf("%d%d%d%d",&n,&m,&s,&t);
  61. FOR(i,,*n-) {
  62. if (i&) FO(j,,m-) scanf("%d",&col[(i-)/][j]);
  63. else FO(j,,m) scanf("%d",&row[i/][j]);
  64. }
  65. while (!Q.empty()) Q.pop();
  66. Q.push(Node(,s,)); vis[][s][]=;
  67. while (!Q.empty()) {
  68. Node tmp=Q.front(); Q.pop();
  69. FO(i,,) {
  70. int now=ps[tmp.pos][i];
  71. if (now==) {
  72. if (tmp.y==||col[tmp.x][tmp.y-]) continue;
  73. if (vis[tmp.x][tmp.y-][now]) goto label;
  74. Q.push(Node(tmp.x,tmp.y-,now));
  75. vis[tmp.x][tmp.y-][now]=;
  76. break;
  77. }
  78. else if (now==) {
  79. if (tmp.x==n-||row[tmp.x+][tmp.y]) continue;
  80. if (vis[tmp.x+][tmp.y][now]) goto label;
  81. Q.push(Node(tmp.x+,tmp.y,now));
  82. vis[tmp.x+][tmp.y][now]=;
  83. break;
  84. }
  85. else if (now==) {
  86. if (tmp.y==m-||col[tmp.x][tmp.y]) continue;
  87. if (vis[tmp.x][tmp.y+][now]) goto label;
  88. Q.push(Node(tmp.x,tmp.y+,now));
  89. vis[tmp.x][tmp.y+][now]=;
  90. break;
  91. }
  92. else {
  93. if (tmp.x==||row[tmp.x][tmp.y]) continue;
  94. if (vis[tmp.x-][tmp.y][now]) goto label;
  95. Q.push(Node(tmp.x-,tmp.y,now));
  96. vis[tmp.x-][tmp.y][now]=;
  97. break;
  98. }
  99. }
  100. }
  101. label: FO(i,,n) FO(j,,m) FO(k,,) if (vis[i][j][k]) {++num; break;}
  102. puts(num==n*m?"YES":"NO");
  103. }
  104. return ;
  105. }

F.Game(高斯消元)

要想去除某些石堆使得先手必败。那么s[i]^s[i+1]^...s[n]=0.即问题转化为求出集合S的子集异或和为0的子集种数。

集合S里的每个数,要么选要么不选,考虑每一位的贡献,那么选了这个数,这个数上二进制位为1的位会贡献1.

于是对于每位,建立异或方程组,再用高斯消元求解这个方程的自由变元的数量即可。

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. int equ, var, a[][N];
  45.  
  46. LL pow_mod(LL a, LL n, LL mod){
  47. LL ret=, temp=a%mod;
  48. while (n) {
  49. if (n&) ret=ret*temp%mod;
  50. temp=temp*temp%mod;
  51. n>>=;
  52. }
  53. return ret;
  54. }
  55. int Guass(){
  56. int row, col;
  57. for(row=,col=; row<equ&&col<var; ++col,++row){
  58. int max_r=row;
  59. FO(i,row+,equ) {
  60. if(a[row][col]==) break;
  61. if(a[max_r][col]<a[i][col]){max_r=i; break;}
  62. }
  63. if(max_r!=row) FOR(j,,var) swap(a[max_r][j],a[row][j]);
  64. if(a[row][col]==) row--;
  65. FO(i,row+,equ) {
  66. if(a[i][col]==) continue;
  67. FOR(j,col,var) a[i][j]^=a[row][j];
  68. }
  69. }
  70. FO(i,row,equ) if(a[i][col]) return -;
  71. return var-row;
  72. }
  73. int main ()
  74. {
  75. int T, n, val;
  76. scanf("%d",&T);
  77. while (T--) {
  78. mem(a,);
  79. scanf("%d",&n);
  80. equ=; var=n;
  81. FO(i,,n) {
  82. scanf("%d",&val);
  83. FO(j,,equ) a[j][i]=val%, val/=;
  84. }
  85. FO(j,,equ) a[j][n]=;
  86. int b=Guass();
  87. printf("%lld\n",pow_mod(,b,MOD));
  88. }
  89. return ;
  90. }

G.Sequence Decomposition(贪心+树状数组)

给出一个序列,每次可以将连续的一段都减去1,每次操作的长度定义为连续段的长度,问最后使得序列都变为0时,最短的操作长度最长是多少。

首先,将操作改变顺序是不影响答案的。不妨从左端点1开始,依次向后看右端点的最佳选值.

如果有a[i]<=a[i+1],那么右端点就可以从i拓展到i+1了。如果有a[i]>a[i+1].那么右端点就不能再继续拓展了。反证证明这个贪心的正确性。

但是如果直接模拟操作的话显然是超时的。注意到每次的操作实际上是区间减,查询单点。可以用树状数组维护。

复杂度O(nlogn).

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. int a[N], tree[N], n;
  45.  
  46. void add(int x, int val){while (x<=n+) tree[x]+=val, x+=lowbit(x);}
  47. int query(int x){
  48. int res=;
  49. while (x) res+=tree[x], x-=lowbit(x);
  50. return res;
  51. }
  52. int main ()
  53. {
  54. int T, ans;
  55. scanf("%d",&T);
  56. while (T--) {
  57. mem(tree,); ans=INF;
  58. scanf("%d",&n);
  59. FOR(i,,n) scanf("%d",a+i), add(i,a[i]), add(i+,-a[i]);
  60. a[n+]=;
  61. int now=;
  62. FOR(i,,n) {
  63. if (a[i]<=a[i+]) continue;
  64. int tmp=a[i]-a[i+];
  65. add(now,-tmp); add(i+,tmp);
  66. FOR(j,now,i) if (query(j)>=) {ans=min(i-j+,ans); now=j; break;}
  67. }
  68. printf("%d\n",ans);
  69. }
  70. return ;
  71. }

H.Road constructions(最大权闭合子图)

裸题。。。不明白考试为啥不看。。。

  1. # include <cstdio>
  2. # include <cstring>
  3. # include <cstdlib>
  4. # include <iostream>
  5. # include <vector>
  6. # include <queue>
  7. # include <stack>
  8. # include <map>
  9. # include <set>
  10. # include <cmath>
  11. # include <algorithm>
  12. using namespace std;
  13. # define lowbit(x) ((x)&(-x))
  14. # define pi acos(-1.0)
  15. # define eps 1e-
  16. # define MOD
  17. # define INF
  18. # define mem(a,b) memset(a,b,sizeof(a))
  19. # define FOR(i,a,n) for(int i=a; i<=n; ++i)
  20. # define FO(i,a,n) for(int i=a; i<n; ++i)
  21. # define bug puts("H");
  22. # define lch p<<,l,mid
  23. # define rch p<<|,mid+,r
  24. # define mp make_pair
  25. # define pb push_back
  26. typedef pair<int,int> PII;
  27. typedef vector<int> VI;
  28. # pragma comment(linker, "/STACK:1024000000,1024000000")
  29. typedef long long LL;
  30. int Scan() {
  31. int x=,f=;char ch=getchar();
  32. while(ch<''||ch>''){if(ch=='-')f=-;ch=getchar();}
  33. while(ch>=''&&ch<=''){x=x*+ch-'';ch=getchar();}
  34. return x*f;
  35. }
  36. void Out(int a) {
  37. if(a<) {putchar('-'); a=-a;}
  38. if(a>=) Out(a/);
  39. putchar(a%+'');
  40. }
  41. const int N=;
  42. //Code begin...
  43.  
  44. struct Edge{int p, next, w;}edge[];
  45. struct Node{int pre, suc, w, id;}node[];
  46. int head[N], cnt=, s, t, vis[N];
  47. int val[N];
  48. queue<int>Q;
  49.  
  50. void add_edge(int u, int v, int w){
  51. edge[cnt].p=v; edge[cnt].w=w; edge[cnt].next=head[u]; head[u]=cnt++;
  52. edge[cnt].p=u; edge[cnt].w=; edge[cnt].next=head[v]; head[v]=cnt++;
  53. }
  54. int bfs(){
  55. int i, v;
  56. mem(vis,-);
  57. vis[s]=; Q.push(s);
  58. while (!Q.empty()) {
  59. v=Q.front(); Q.pop();
  60. for (i=head[v]; i; i=edge[i].next) {
  61. if (edge[i].w> && vis[edge[i].p]==-) {
  62. vis[edge[i].p]=vis[v] + ;
  63. Q.push(edge[i].p);
  64. }
  65. }
  66. }
  67. return vis[t]!=-;
  68. }
  69. int dfs(int x, int low){
  70. int i, a, temp=low;
  71. if (x==t) return low;
  72. for (i=head[x]; i; i=edge[i].next) {
  73. if (edge[i].w> && vis[edge[i].p]==vis[x]+){
  74. a=dfs(edge[i].p,min(edge[i].w,temp));
  75. temp-=a; edge[i].w-=a; edge[i^].w += a;
  76. if (temp==) break;
  77. }
  78. }
  79. if (temp==low) vis[x]=-;
  80. return low-temp;
  81. }
  82. void init(){mem(head,); mem(val,); cnt=;}
  83. int main ()
  84. {
  85. int n, m, k;
  86. while (scanf("%d%d",&n,&m), n+m) {
  87. int res=, sum=, tmp;
  88. s=; t=m+; init();
  89. FOR(i,,m) scanf("%d",&tmp), res+=tmp, add_edge(s,i,tmp);
  90. scanf("%d",&k);
  91. FOR(i,,k) scanf("%d%d%d%d",&node[i].pre,&node[i].suc,&node[i].id,&node[i].w), val[node[i].id]+=node[i].w;
  92. FOR(i,,k) FOR(j,i+,k) {
  93. if (node[i].id==node[j].id) continue;
  94. if (node[i].suc==node[j].pre) add_edge(node[i].id,node[j].id,INF);
  95. else if (node[i].pre==node[j].suc) add_edge(node[j].id,node[i].id,INF);
  96. }
  97. FOR(i,,m) add_edge(i,t,val[i]);
  98. while (bfs()) while (tmp=dfs(s,INF)) sum+=tmp;
  99. printf("%d\n",res-sum);
  100. }
  101. return ;
  102. }

2011 Multi-University Training Contest 8 - Host by HUST的更多相关文章

  1. 2011 Multi-University Training Contest 1 - Host by HNU

    A.A + B problem(待填坑) B.Cat VS Dog(二分图匹配) 喜欢cat和喜欢dog的人构成了二分图,如果两个人有冲突则连一条边,则问题转化为二分图最大点独立集问题.ans=n-最 ...

  2. 2011 Multi-University Training Contest 7 - Host by ECNU

    AC: F I. rank 40/88. 开场看了F发现是个简单的DP,随便写了一下WA,,,发现把样例倒着输就过不了了...原来是忘了最后的时候开始上课的话可能上不了多久... 想到一个简洁的状态方 ...

  3. 2011 Multi-University Training Contest 6 - Host by JLU

    打了4hours,做出一道题...太菜了.rank:45/107 开场看B,题目看不懂...3hours半才发现i<=N-1,不是i<=x-1.然而还是不会. 看到J有人过了,发现是个简单 ...

  4. 2011 Multi-University Training Contest 4 - Host by SDU

    A.Color the Simple Cycle(polya计数+字符串匹配) 此题的难点在于确定置换的个数,由a[i+k]=a[i], e[i+k]=e[i]联想到KMP. 于是把原串和原串扩大两倍 ...

  5. 2015 UESTC Winter Training #8【The 2011 Rocky Mountain Regional Contest】

    2015 UESTC Winter Training #8 The 2011 Rocky Mountain Regional Contest Regionals 2011 >> North ...

  6. HDU4888 Redraw Beautiful Drawings(2014 Multi-University Training Contest 3)

    Redraw Beautiful Drawings Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Jav ...

  7. HDU 2018 Multi-University Training Contest 3 Problem A. Ascending Rating 【单调队列优化】

    任意门:http://acm.hdu.edu.cn/showproblem.php?pid=6319 Problem A. Ascending Rating Time Limit: 10000/500 ...

  8. 2015 Multi-University Training Contest 8 hdu 5390 tree

    tree Time Limit: 8000ms Memory Limit: 262144KB This problem will be judged on HDU. Original ID: 5390 ...

  9. hdu 4946 2014 Multi-University Training Contest 8

    Area of Mushroom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

随机推荐

  1. 20145209刘一阳《网络对抗》Exp6信息搜集与漏洞扫描

    20145209刘一阳<网络对抗>Exp6信息搜集与漏洞扫描 实践内容 信息搜集和漏洞扫描 信息搜集 whois查询 用whois查询博客园网站的域名注册信息可以得到注册人的名字.城市等信 ...

  2. 厦门Uber优步司机奖励政策(12月21日-12.27日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  3. Python-内置函数3

    '''1.lambda 声明一个匿名函数,并且自动给你返回值2.map()3.float()4.globals()5.locals()6.input()7.print()8.int()9.int()1 ...

  4. ASP.NET数据库连接

    启动Visual Studio,新建一个web工程 点开工程目录下web.config文件, 找到节点,新增数据库配置 aspx界面新建一个button和一个文本框用于测试数据库连接, 其中butto ...

  5. PS 拉伸大长腿

    1.打开一个图片工具栏--图像--画布大小 2.选择矩形选框工具--框住要拉升退的位置--然后在按Ctrl+T,进行拉伸即可

  6. pyhon文件操作典型代码实现(非常经典!)

    1. 编写一个程序,统计当前目录下每个文件类型的文件数,程序实现如图: 实现代码: import os all_files = os.listdir(os.chdir("D:\\" ...

  7. HDU - 6444(单调队列+思维)

    链接:HDU - 6444 题意:给出一个包含 n 个数的环,每个数都有一个价值,起点任选,每次跳顺时针跳 k 个数,在哪个数就能获得该价值(包括起点),最多取 m 次,问最少需要补充多少价值,所拿的 ...

  8. H5应用程序缓存浅谈及实际测试

    应用程序缓存能做什么? 可以在脱离网络的条件下离线访问. 减少读取服务器文件,减轻服务器的访问压力. 优化网站打开速度. 如何启用应用缓存? 第一步:给服务器添加新的MIME:扩展名:.appcach ...

  9. 代码对齐 (Alignment of Code,ACM/ICPC NEERC 2010,UVa1593)

    题目描述: 解题思路: 输入时提出单个字符串,并用一个数组记录每列最长长度,格式化输出 #include <iostream> #include <algorithm> #in ...

  10. 同台服务器 部署多个tomcat 需要做的修改

    需要修改以下加粗部分: 1:访问端口 8080->8081 2:shutdown 端口 8005->8015 3: AJP端口 8001->8010 <?xml version ...