怎么老是垫底啊。

不高兴。

似乎 A 掉一道题总比别人慢一些。


A. Paint the Numbers

贪心,从小到大枚举,如果没有被涂色,就新增一个颜色把自己和倍数都涂上。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 100 + 7;
  20. int n;
  21. int a[N], col[N];
  22. inline void work() {
  23. int cnt = 0, ans = 0;
  24. std::sort(a + 1, a + n + 1);
  25. for (int i = 1; i <= n; ++i)
  26. if (!col[i]) {
  27. ++ans;
  28. for (int j = i; j <= n; ++j) if (a[j] % a[i] == 0) col[j] = ans;
  29. }
  30. printf("%d\n", ans);
  31. }
  32. inline void init() {
  33. read(n);
  34. for (int i = 1; i <= n; ++i) read(a[i]);
  35. }
  36. int main() {
  37. #ifdef hzhkk
  38. // freopen("hkk.in", "r", stdin);
  39. #endif
  40. init();
  41. work();
  42. fclose(stdin), fclose(stdout);
  43. return 0;
  44. }

B. Koala and Lights

状态的循环节不会超过 \(\operatorname{lcm}(1..10)\),所以直接暴力。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 100 + 7;
  20. const int M = 100000 + 7;
  21. int n;
  22. char s[N];
  23. int a[N], b[N];
  24. inline void work() {
  25. int ans = 0;
  26. for (int i = 0; i <= 100000; ++i) {
  27. int cnt = 0;
  28. for (int j = 1; j <= n; ++j)
  29. if (s[j] == '0' && (i >= b[j] && 0 <= (i - b[j]) % a[j] && (i - b[j]) % a[j] < a[j] / 2)) ++cnt;
  30. else if (s[j] == '1' && (i >= b[j] && (i - b[j]) % a[j] >= a[j] / 2)) ++cnt;
  31. else if (s[j] == '1' && i < b[j]) ++cnt;
  32. smax(ans, cnt);
  33. // dbg("i = %d, cnt = %d\n", i, cnt);
  34. }
  35. printf("%d\n", ans);
  36. }
  37. inline void init() {
  38. read(n);
  39. scanf("%s", s + 1);
  40. for (int i = 1; i <= n; ++i) read(a[i]), read(b[i]), a[i] <<= 1;
  41. }
  42. int main() {
  43. #ifdef hzhkk
  44. // freopen("hkk.in", "r", stdin);
  45. #endif
  46. init();
  47. work();
  48. fclose(stdin), fclose(stdout);
  49. return 0;
  50. }

C. Paint the Digits

一开始没读懂题目,以为是只要涂 \(1\) 的单调不降,涂 \(2\) 的也单调不降就可以了。

写了一发然后 Wa1。。。

实际上是把所有涂 \(2\) 的一次接在涂 \(1\) 的后面,整个单调不降。

既然这样,那么就先把所有数排序,然后先找到最前面的几个原坐标上升的全部选为 \(1\)。然后贪心的把后面的开始不满足的那个值,位于之间的最后一个坐标的后面的全部选为 \(1\)。然后剩下的都是 \(2\),判断一下合不合法。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 2e5 + 7;
  20. int n;
  21. char a[N], ans[N];
  22. int kk[N];
  23. pii b[N];
  24. inline void work() {
  25. std::sort(b + 1, b + n + 1);
  26. int pos = -1;
  27. ans[b[1].se] = '1';
  28. for (int i = 2; i <= n; ++i) if (b[i].se < b[i - 1].se) {
  29. pos = i;
  30. // dbg("------------");
  31. break;
  32. } else ans[b[i].se] = '1';//, dbg("*** %d\n", b[i].se);
  33. if (pos == -1) {
  34. for (int i = 1; i <= n; ++i) putchar('1');
  35. puts("");
  36. return;
  37. }
  38. int nn = b[pos].fi, pp = b[pos - 1].se;
  39. for (int i = pos; i <= n; ++i)
  40. if (b[i].fi == nn && b[i].se > pp) ans[b[i].se] = '1';
  41. kk[0] = 0;
  42. for (int i = 1; i <= n; ++i) if (ans[i] == '1') kk[++kk[0]] = a[i];//, dbg("*** %d\n", i);
  43. for (int i = 1; i <= n; ++i) if (ans[i] == '2') kk[++kk[0]] = a[i];
  44. if (!std::is_sorted(kk + 1, kk + n + 1)) puts("-");
  45. else {
  46. for (int i = 1; i <= n; ++i) putchar(ans[i]);
  47. puts("");
  48. }
  49. }
  50. inline void init() {
  51. read(n);
  52. scanf("%s", a + 1);
  53. for (int i = 1; i <= n; ++i) a[i] -= '0', b[i] = pii(a[i], i), ans[i] = '2';
  54. }
  55. int main() {
  56. #ifdef hzhkk
  57. // freopen("hkk.in", "r", stdin);
  58. #endif
  59. int T;
  60. read(T);
  61. while (T--) {
  62. init();
  63. work();
  64. }
  65. fclose(stdin), fclose(stdout);
  66. return 0;
  67. }

D. Cow and Snacks

至少有一个人会吃到两份,不妨设其中的一份为 \(A\)。那么剩下来的所有人的两种备选食物中有 \(A\) 的,都只能去吃另一份了,设这一份为 \(C\),那么再剩下来的所有人的备选食物中有 \(C\) 的也都只能去另一份……以此类推。

可以发现这样的关系实际上是一棵树,所以随便求一个生成树就可以了。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 1e5 + 7;
  20. int n, m, ans;
  21. int dep[N], vis[N];
  22. struct Edge { int to, ne; } g[N << 1]; int head[N], tot = 1;
  23. inline void addedge(int x, int y) { g[++tot].to = y, g[tot].ne = head[x], head[x] = tot; }
  24. inline void adde(int x, int y) { addedge(x, y), addedge(y, x); }
  25. inline void dfs(int x, int fr = -1, int fa = 0) {
  26. vis[x] = 1, dep[x] = dep[fa] + 1;
  27. for fec(i, x, y) if ((i ^ fr) != 1) {
  28. // dbg("****** %d %d\n", x, y);
  29. if (!vis[y]) dfs(y, i, x);
  30. else if (dep[y] > dep[x]) ++ans;
  31. }
  32. }
  33. inline void work() {
  34. for (int i = 1; i <= n; ++i) if (!vis[i]) dfs(i);
  35. printf("%d\n", ans);
  36. }
  37. inline void init() {
  38. read(n), read(m);
  39. for (int i = 1; i <= m; ++i) {
  40. int x, y;
  41. read(x), read(y);
  42. adde(x, y);
  43. }
  44. }
  45. int main() {
  46. #ifdef hzhkk
  47. // freopen("hkk.in", "r", stdin);
  48. #endif
  49. init();
  50. work();
  51. fclose(stdin), fclose(stdout);
  52. return 0;
  53. }

E. Rotate Columns

很容易想到一个暴力:

设 \(f[i][S]\) 表示第 \(i\) 列中,选了 \(S\) 中的行的位置的数的最大和。这个可以通过 \(O(mn2^n)\) 预处理出来。

然后 \(dp[i][S]\) 表示前 \(i\) 列已经占据了 \(S\) 中的每一行的最大和。这个直接枚举子集转移,时间复杂度 \(O(m3^n)\)。

可以通过 Easy Version。

然后考虑,是否每一列都是有必要的。可以发现,只有最大值最大的 \(n\) 列才是有用的,因为不管怎么说,只要有了这 \(n\) 列,即使每一列的最大值直接填补每一行,都可以得到一个不错的结果。而想要更优,也只能是在这几列里面选择。可以这要考虑,如果有两行不是在这 \(n\) 列中选的,那么这 \(n\) 列中至少有两列没有被用上,只需要用这两列的最大值代替不是在这 \(n\) 列中选的两行得到的结果一定更优。

然后复杂度降低为 \(O(n^22^n+n3^n)\)。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 15;
  20. const int M = 2000 + 7;
  21. const int NP = (1 << 12) + 7;
  22. int n, m, S;
  23. int a[N][M], dp[M][NP], f[M][NP], tt[NP];
  24. pii bb[M], b[N][M];
  25. inline void work() {
  26. for (int j = 1; j <= m; ++j) {
  27. int mx = 0;
  28. for (int i = 1; i <= n; ++i) smax(mx, a[i][j]);
  29. bb[j] = pii(-mx, j);
  30. }
  31. std::sort(bb + 1, bb + m + 1);
  32. smin(m, n);
  33. S = (1 << n) - 1;
  34. for (int jj = 1; jj <= m; ++jj) {
  35. int j = bb[jj].se;
  36. for (int s = 0; s <= S; ++s) tt[s] = 0, f[jj][s] = 0;
  37. for (int s = 0; s <= S; ++s)
  38. for (int i = 1; i <= n; ++i) if ((s >> (i - 1)) & 1) tt[s] += a[i][j];
  39. for (int s = 0; s <= S; ++s)
  40. for (int i = 1; i <= n; ++i) smax(f[jj][s], tt[(s >> i) | ((s & ((1 << i) - 1)) << (n - i))]);
  41. // for (int s = 0; s <= S; ++s) dbg("f[%d][%d] = %d, tt = %d\n", j, s, f[j][s], tt[s]);
  42. }
  43. for (int j = 1; j <= m; ++j) {
  44. for (int s = 0; s <= S; ++s) dp[j][s] = f[j][s];
  45. for (int s = 0; s <= S; ++s)
  46. for (int sta = s; sta; sta = (sta - 1) & s) smax(dp[j][s], dp[j - 1][sta] + f[j][s ^ sta]);
  47. // for (int s = 0; s <= S; ++s) dbg("dp[%d][%d] = %d\n", j, s, dp[j][s]);
  48. }
  49. printf("%d\n", dp[m][S]);
  50. }
  51. inline void init() {
  52. read(n), read(m);
  53. for (int i = 1; i <= n; ++i)
  54. for (int j = 1; j <= m; ++j) read(a[i][j]);
  55. }
  56. int main() {
  57. #ifdef hzhkk
  58. // freopen("hkk.in", "r", stdin);
  59. #endif
  60. int T;
  61. read(T);
  62. while (T--) {
  63. init();
  64. work();
  65. }
  66. fclose(stdin), fclose(stdout);
  67. return 0;
  68. }

F. Koala and Notebook

因为要的是数值最小(比赛的时候一直以为是字典序最小),所以最优的位数可以直接求出了。

那么位数固定了以后,我们可以把原来的每一条边都拆成边权的位数条边,每一条的边权是每一位,这样走一条边的时候一定是一位了。

然后类似于 NOIP2018D2T1 直接贪心走最小的边权(要保证边通往的点的答案的位数一定恰好比当前点大 \(1\))就可以了。

不过这里有一个问题,就是每一个点可能会有很多条边权相同的边。所以我们类似于 01bfs,每次将所有的答案一样的点放到一起,统一从小到大枚举边权以后再枚举每一个点来扩展。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 1e5 * 11 + 7;
  20. const int P = 1e9 + 7;
  21. int n, m, nod, hd, tl;
  22. int buf[10], dis[N], q[N], ans[N];//, pre[N], prec[N];
  23. std::vector<int> g[N][10];
  24. inline void bfs() {
  25. int hd = 0, tl = 1;
  26. q[hd = 0, tl = 1] = 1, dis[1] = 1;
  27. while (hd < tl) {
  28. int l = hd + 1, r = l;
  29. while (r < tl && ans[q[r + 1]] == ans[q[l]]) ++r;
  30. // dbg("i = %d, r = %d, tl = %d\n", i, r, tl);
  31. for (int j = 0; j < 10; ++j)
  32. for (int k = l; k <= r; ++k) {
  33. int x = q[k];
  34. // dbg("x = %d\n", x);
  35. for (int y : g[x][j]) if (!dis[y]) {
  36. dis[y] = dis[x] + 1;
  37. ans[y] = (ans[x] * 10ll + j) % P;
  38. q[++tl] = y;
  39. }
  40. }
  41. hd = r;
  42. }
  43. }
  44. /*
  45. inline void dfs(int x) {
  46. // dbg("x = %d, ans[x] = %d\n", x, ans[x]);
  47. vis[x] = 1;
  48. for (int i = 0; i < 10; ++i) {
  49. int y = g[x][i];
  50. if (!y || dis[y] != dis[x] + 1 || vis[y]) continue;
  51. ans[y] = (ans[x] * 10ll + i) % P;
  52. dfs(y);
  53. }
  54. }*/
  55. inline void work() {
  56. bfs();
  57. // dfs(1);
  58. // if (m == 99681) {
  59. // int x = 133 + 1;
  60. // for (; x; x = pre[x]) printf("** %d %d\n", x, ans[x]);
  61. // }
  62. for (int i = 2; i <= n; ++i) printf("%d\n", ans[i]);
  63. }
  64. inline void init() {
  65. read(n), read(m);
  66. nod = n;
  67. for (int i = 1; i <= m; ++i) {
  68. int xx, yy, z, x, y;
  69. read(xx), read(yy);
  70. if (xx > yy) std::swap(xx, yy);
  71. z = i, x = xx, buf[0] = 0;
  72. while (z) buf[++buf[0]] = z % 10, z /= 10;
  73. while (buf[0] > 1) {
  74. g[x][buf[buf[0]--]].pb(++nod);
  75. x = nod;
  76. // dbg("i = %d, x = %d\n", i, x);
  77. }
  78. g[x][buf[buf[0]]].pb(yy);
  79. if (xx == 1) continue;
  80. z = i, y = yy, buf[0] = 0;
  81. while (z) buf[++buf[0]] = z % 10, z /= 10;
  82. while (buf[0] > 1) {
  83. g[y][buf[buf[0]--]].pb(++nod);
  84. y = nod;
  85. }
  86. g[y][buf[buf[0]]].pb(xx);
  87. }
  88. }
  89. int main() {
  90. #ifdef hzhkk
  91. freopen("hkk.in", "r", stdin);
  92. #endif
  93. init();
  94. work();
  95. fclose(stdin), fclose(stdout);
  96. return 0;
  97. }

G1. Into Blocks (easy version)

同一个数值必须在同一块中。于是考虑把每一个数值的最左边和最右边搞出来形成 \(m\) 个区间,然后对于所有相交的区间必须在同一块。那么形成了很多块以后每一个块内统计一下哪一种数值的出现次数最多,统一改成这个数值。

  1. #include<bits/stdc++.h>
  2. #define fec(i, x, y) (int i = head[x], y = g[i].to; i; i = g[i].ne, y = g[i].to)
  3. #define dbg(...) fprintf(stderr, __VA_ARGS__)
  4. #define File(x) freopen(#x".in", "r", stdin), freopen(#x".out", "w", stdout)
  5. #define fi first
  6. #define se second
  7. #define pb push_back
  8. template<typename A, typename B> inline char smax(A &a, const B &b) {return a < b ? a = b , 1 : 0;}
  9. template<typename A, typename B> inline char smin(A &a, const B &b) {return b < a ? a = b , 1 : 0;}
  10. typedef long long ll; typedef unsigned long long ull; typedef std::pair<int, int> pii;
  11. template<typename I>
  12. inline void read(I &x) {
  13. int f = 0, c;
  14. while (!isdigit(c = getchar())) c == '-' ? f = 1 : 0;
  15. x = c & 15;
  16. while (isdigit(c = getchar())) x = (x << 1) + (x << 3) + (c & 15);
  17. f ? x = -x : 0;
  18. }
  19. const int N = 200000 + 7;
  20. int n, m, q, mm;
  21. int a[N], kk[N], cc[N];
  22. struct Int {
  23. int l, r;
  24. } b[N];
  25. inline void work() {
  26. for (int i = 1; i <= m; ++i) b[i].r = 0, b[i].l = n + 1;
  27. for (int i = 1; i <= n; ++i) smin(b[a[i]].l, i), smax(b[a[i]].r, i);
  28. mm = 0;
  29. for (int i = 1; i <= m; ++i) if (b[i].r >= b[i].l) b[++mm] = b[i];//, dbg("*** %d %d\n", b[i].l, b[i].r);
  30. std::sort(b + 1, b + mm + 1, [](const Int &a, const Int &b) {
  31. return a.l < b.l;
  32. });
  33. int rr = 0, lr = 0, ans = 0;
  34. for (int i = 1; i <= mm; ++i) {
  35. if (rr < b[i].l) {
  36. kk[0] = 0;
  37. int cnt = n + 1;
  38. for (int j = lr; j <= rr; ++j) {
  39. if (!cc[a[j]]) kk[++kk[0]] = a[j];
  40. ++cc[a[j]];
  41. }
  42. for (int j = 0; j <= kk[0]; ++j) smin(cnt, rr - lr + 1 - cc[kk[j]]), cc[kk[j]] = 0;
  43. lr = b[i].l, ans += cnt;
  44. }
  45. smax(rr, b[i].r);
  46. }
  47. kk[0] = 0;
  48. int cnt = n + 1;
  49. for (int j = lr; j <= n; ++j) {
  50. if (!cc[a[j]]) kk[++kk[0]] = a[j];
  51. ++cc[a[j]];
  52. }
  53. for (int j = 0; j <= kk[0]; ++j) smin(cnt, rr - lr + 1 - cc[kk[j]]), cc[kk[j]] = 0;
  54. ans += cnt;
  55. printf("%d\n", ans);
  56. }
  57. inline void init() {
  58. read(n), read(q);
  59. for (int i = 1; i <= n; ++i) read(a[i]), smax(m, a[i]);
  60. }
  61. int main() {
  62. #ifdef hzhkk
  63. // freopen("hkk.in", "r", stdin);
  64. #endif
  65. init();
  66. work();
  67. fclose(stdin), fclose(stdout);
  68. return 0;
  69. }

未完待续

Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2)的更多相关文章

  1. 状压DP--Rotate Columns (hard version)-- Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2)

    题意:https://codeforc.es/problemset/problem/1209/E2 给你一个n(1-12)行m(1-2000)列的矩阵,每一列都可以上下循环移动(类似密码锁). 问你移 ...

  2. Cow and Snacks(吃点心--图论转换) Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2)

    题意:https://codeforc.es/contest/1209/problem/D 有n个点心,有k个人,每个人都有喜欢的两个点心,现在给他们排个队,一个一个吃,每个人只要有自己喜欢的点心就会 ...

  3. Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2) G1. Into Blocks (easy version)

    题目:https://codeforc.es/contest/1209/problem/G1 题意:给你一个序列,要你进行一些操作后把他变成一个好序列,好序列的定义是,两个相同的数中间的数都要与他相同 ...

  4. Codeforces Round #584 - Dasha Code Championship - Elimination Round (rated, open for everyone, Div. 1 + Div. 2)C

    #define HAVE_STRUCT_TIMESPEC#include<bits/stdc++.h>using namespace std;string s;pair<int,in ...

  5. codeforces(Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) )(C,D)

    C. Destroying Array time limit per test 1 second memory limit per test 256 megabytes input standard ...

  6. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) B. Verse Pattern 水题

    B. Verse Pattern 题目连接: http://codeforces.com/contest/722/problem/B Description You are given a text ...

  7. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined)(set容器里count函数以及加强for循环)

    题目链接:http://codeforces.com/contest/722/problem/D 1 #include <bits/stdc++.h> #include <iostr ...

  8. Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) A B C D 水 模拟 并查集 优先队列

    A. Broken Clock time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  9. 二分 Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) D

    http://codeforces.com/contest/722/problem/D 题目大意:给你一个没有重复元素的Y集合,再给你一个没有重复元素X集合,X集合有如下操作 ①挑选某个元素*2 ②某 ...

随机推荐

  1. 8.为什么IntelliJ IDEA首次加载比较慢

    double shift 很快,是有缓存,和快速索引 这面这二个文件,配置会缓存:会越来越在,

  2. linux find rm ls 逻辑非运用

    需求场景描述 查找出除已知文件外的文件 办法: [root@VM_58_118_centos test]# .1_fv1..0_pv1..6_15752678845473..2_fv1..4_pv1. ...

  3. [CSP-S模拟测试]:不等式(数学)

    题目描述 小$z$热衷于数学.今天数学课的内容是解不等式:$L\leqslant S\times x\leqslant R$.小$z$心想这也太简单了,不禁陷入了深深的思考:假如已知$L,R,S,M$ ...

  4. easyui的datagrid里getSelections只能获取一行值???

    使用getSelections只能获取到一行的值,检查了半天是因为idField属性值写错,更正之后ok. 解决办法二:改为使用getChecked,idField写错无影响, 注: getSelec ...

  5. php面试专题---MySQL分区

    php面试专题---MySQL分区 一.总结 一句话总结: mysql的分区操作还比较简单,好处是也不用自己动手建表进行分区,和水平分表有点像 1.mysql分区简介? 一个表或索引-->N个物 ...

  6. xpath使用技巧

    爬虫中我们对于元素的定位有多种方法,大致有: Beautifulsoup.Xpath和正则表达式三种方式 其中效率比较为: Beautifulsoup<Xpath<正则表达式 习惯了使用B ...

  7. crazyflie四轴飞行器

    源地址:http://www.bitcraze.se/2013/02/pre-order-has-started/ Crazyflie是一个开源的纳米四旋翼 来几张靓照 开发平台是开源的,所以原理图和 ...

  8. jmeter之ServerAgent监控资源

    对linux服务器的服务进行压测时,服务器的运行情况可以通过添加插件来观察,而不用使用top命令实时的去看 1.资源准备 2.环境准备 3.资源监控 1.资源准备 可通过该网址下载jmeter所有插件 ...

  9. vue.jsc初体验

    Vue 1.安装脚手架 (1)npm install -g vue-cli (2)Vue -v //查看是否安装成功 (3)Vue init webpack name(名称) (4)Npm insta ...

  10. 关于VMWare的几种网络模式

    具体的可以参考这个博文:http://zhenyaliu.blog.163.com/blog/static/2377571920103775447527/