最近省队前联考被杭二成七南外什么的吊锤得布星,拿一场Div. 2恢复信心

然后Div.2 Rk3、Div. 1+Div. 2 Rk9,rating大涨200引起舒适

现在的Div. 2都怎么了,最难题难度都快接近3K了……

A. Detective Book

记\(a_i\)的前缀最大值为\(Max_i\),那么要求的就是\(Max_i = i\)的\(i\)的数量

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstdlib>
  4. #include<ctime>
  5. #include<cctype>
  6. #include<algorithm>
  7. #include<cstring>
  8. #include<iomanip>
  9. #include<queue>
  10. #include<map>
  11. #include<set>
  12. #include<bitset>
  13. #include<vector>
  14. #include<cmath>
  15. #include<random>
  16. //This code is written by Itst
  17. using namespace std;
  18. inline int read(){
  19. int a = 0;
  20. char c = getchar();
  21. bool f = 0;
  22. while(!isdigit(c) && c != EOF){
  23. if(c == '-')
  24. f = 1;
  25. c = getchar();
  26. }
  27. if(c == EOF)
  28. exit(0);
  29. while(isdigit(c)){
  30. a = a * 10 + c - 48;
  31. c = getchar();
  32. }
  33. return f ? -a : a;
  34. }
  35. int main(){
  36. #ifndef ONLINE_JUDGE
  37. freopen("in","r",stdin);
  38. //freopen("out","w",stdout);
  39. #endif
  40. int N = read() , maxN = 0 , cnt = 0;
  41. for(int i = 1 ; i <= N ; ++i){
  42. maxN = max(maxN , read());
  43. if(maxN == i) ++cnt;
  44. }
  45. cout << cnt;
  46. return 0;
  47. }

B. Good String

注意到如果字符串最右侧是一个'<'或者最左侧是一个'>'的话,我们只需要一直对最右边或者最左边的字符进行操作就可以满足条件

所以我们只需要在字符串首尾删去尽可能少的字符使得其最右侧是一个‘<’或者最左侧是一个'>'。

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstdlib>
  4. #include<ctime>
  5. #include<cctype>
  6. #include<algorithm>
  7. #include<cstring>
  8. #include<iomanip>
  9. #include<queue>
  10. #include<map>
  11. #include<set>
  12. #include<bitset>
  13. #include<vector>
  14. #include<cmath>
  15. #include<random>
  16. //This code is written by Itst
  17. using namespace std;
  18. inline int read(){
  19. int a = 0;
  20. char c = getchar();
  21. bool f = 0;
  22. while(!isdigit(c) && c != EOF){
  23. if(c == '-')
  24. f = 1;
  25. c = getchar();
  26. }
  27. if(c == EOF)
  28. exit(0);
  29. while(isdigit(c)){
  30. a = a * 10 + c - 48;
  31. c = getchar();
  32. }
  33. return f ? -a : a;
  34. }
  35. int main(){
  36. #ifndef ONLINE_JUDGE
  37. freopen("in","r",stdin);
  38. //freopen("out","w",stdout);
  39. #endif
  40. int T;
  41. for(cin >> T ; T ; --T){
  42. string s;
  43. int len;
  44. cin >> len >> s;
  45. if(s[0] == '<' && s[s.size() - 1] == '>'){
  46. int cnt1 = 0 , cnt2 = 0;
  47. for(int i = 0 ; i < s.size() && s[i] == '<' ; ++i)
  48. ++cnt1;
  49. for(int i = s.size() - 1 ; i >= 0 && s[i] == '>' ; --i)
  50. ++cnt2;
  51. cout << min(cnt1 , cnt2) << endl;
  52. }
  53. else cout << 0 << endl;
  54. }
  55. return 0;
  56. }

C. Playlist

从大到小枚举选择的乐曲中最小的愉悦值,用一个堆维护愉悦值大于等于当前枚举值的所有乐曲的播放时间前\(k\)大

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstdlib>
  4. #include<ctime>
  5. #include<cctype>
  6. #include<algorithm>
  7. #include<cstring>
  8. #include<iomanip>
  9. #include<queue>
  10. #include<map>
  11. #include<set>
  12. #include<bitset>
  13. #include<vector>
  14. #include<cmath>
  15. #include<random>
  16. //This code is written by Itst
  17. using namespace std;
  18. #define int long long
  19. inline int read(){
  20. int a = 0;
  21. char c = getchar();
  22. bool f = 0;
  23. while(!isdigit(c) && c != EOF){
  24. if(c == '-')
  25. f = 1;
  26. c = getchar();
  27. }
  28. if(c == EOF)
  29. exit(0);
  30. while(isdigit(c)){
  31. a = a * 10 + c - 48;
  32. c = getchar();
  33. }
  34. return f ? -a : a;
  35. }
  36. #define PII pair < int , int >
  37. #define st first
  38. #define nd second
  39. bool p(PII a , PII b){return a.st > b.st;}
  40. signed main(){
  41. #ifndef ONLINE_JUDGE
  42. freopen("in","r",stdin);
  43. //freopen("out","w",stdout);
  44. #endif
  45. int N , K;
  46. cin >> N >> K;
  47. vector < PII > song;
  48. priority_queue < int , vector < int > , greater < int > > q;
  49. int sum = 0 , ans = 0;
  50. for(int i = 1 ; i <= N ; ++i){
  51. int k = read() , b = read();
  52. song.push_back(PII(b , k));
  53. }
  54. sort(song.begin() , song.end() , p);
  55. for(auto t : song){
  56. q.push(t.nd);
  57. sum += t.nd;
  58. if(q.size() > K){
  59. sum -= q.top();
  60. q.pop();
  61. }
  62. ans = max(ans , t.st * sum);
  63. }
  64. cout << ans;
  65. return 0;
  66. }

D. Minimum Triangulation

可以证明最优的划分方案中,\(1\)与所有点都有一条边。所以直接计算\(\sum\limits_{i=2}^{n-1} i \times (i+1)\)即可

我觉得可以直接从样例看出这个结论

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<cstdlib>
  4. #include<ctime>
  5. #include<cctype>
  6. #include<algorithm>
  7. #include<cstring>
  8. #include<iomanip>
  9. #include<queue>
  10. #include<map>
  11. #include<set>
  12. #include<bitset>
  13. #include<vector>
  14. #include<cmath>
  15. #include<random>
  16. //This code is written by Itst
  17. using namespace std;
  18. #define int long long
  19. inline int read(){
  20. int a = 0;
  21. char c = getchar();
  22. bool f = 0;
  23. while(!isdigit(c) && c != EOF){
  24. if(c == '-')
  25. f = 1;
  26. c = getchar();
  27. }
  28. if(c == EOF)
  29. exit(0);
  30. while(isdigit(c)){
  31. a = a * 10 + c - 48;
  32. c = getchar();
  33. }
  34. return f ? -a : a;
  35. }
  36. #define PII pair < int , int >
  37. #define st first
  38. #define nd second
  39. bool p(PII a , PII b){return a.st > b.st;}
  40. signed main(){
  41. #ifndef ONLINE_JUDGE
  42. freopen("in","r",stdin);
  43. //freopen("out","w",stdout);
  44. #endif
  45. int N , sum = 0;
  46. cin >> N;
  47. for(int i = 3 ; i <= N ; ++i)
  48. sum = sum + i * (i - 1);
  49. cout << sum;
  50. return 0;
  51. }

E. Palindrome-less Arrays

既然不能存在长度\(>1\)的奇回文串,那么一定不能存在长度为\(3\)的回文串,也就意味着\(\forall i \in [1,n-2] , a_i \neq a_{i+2}\)

把下标为奇数和下标为偶数的\(a_i\)拿出来作为两个序列\(b_i,c_i\),那么我们只需要\(b_i \neq b_{i+1} , c_i \neq c_{i+1}\)就是合法的方案

对于两个序列分别dp,设\(f_{i,0/1}\)表示当前已经填完前\(i\)个数,且第\(i\)个数的值与\(i\)之后的第一个有限制的位置的值是否相等的方案数,转移分有限制的点和无限制的点。

边界情况有点多需要注意。

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<vector>
  4. #include<cstring>
  5. //This code is written by Itst
  6. using namespace std;
  7. #define int long long
  8. inline int read(){
  9. int a = 0;
  10. char c = getchar();
  11. bool f = 0;
  12. while(!isdigit(c) && c != EOF){
  13. if(c == '-')
  14. f = 1;
  15. c = getchar();
  16. }
  17. if(c == EOF)
  18. exit(0);
  19. while(isdigit(c)){
  20. a = a * 10 + c - 48;
  21. c = getchar();
  22. }
  23. return f ? -a : a;
  24. }
  25. const int MAXN = 2e5 + 7 , MOD = 998244353;
  26. int dp[MAXN][2] , arr[MAXN] , N , K;
  27. inline int poww(int a , int b){
  28. int times = 1;
  29. while(b){
  30. if(b & 1) times = times * a % MOD;
  31. a = a * a % MOD;
  32. b >>= 1;
  33. }
  34. return times;
  35. }
  36. signed main(){
  37. #ifndef ONLINE_JUDGE
  38. freopen("in","r",stdin);
  39. //freopen("out","w",stdout);
  40. #endif
  41. N = read(); K = read();
  42. for(int i = 1 ; i <= N ; ++i)
  43. arr[i] = read();
  44. vector < int > ind;
  45. ind.clear();
  46. for(int i = 1 ; i <= N ; i += 2)
  47. if(arr[i] != -1)
  48. ind.push_back((i + 1) >> 1);
  49. int times1 , times2;
  50. if(!ind.empty()){
  51. dp[0][0] = 1;
  52. int pos = 0;
  53. for(int i = 1 ; pos < ind.size() ; ++i)
  54. if(ind[pos] == i){
  55. dp[i][0] = dp[i - 1][0];
  56. if(++pos < ind.size() && arr[ind[pos] * 2 - 1] == arr[ind[pos - 1] * 2 - 1])
  57. swap(dp[i][0] , dp[i][1]);
  58. }
  59. else{
  60. if(i == 1){
  61. dp[i][0] = K - 1; dp[i][1] = 1;
  62. }
  63. else{
  64. dp[i][0] = (dp[i - 1][0] * (K - 2) + dp[i - 1][1] * (K - 1)) % MOD;
  65. dp[i][1] = dp[i - 1][0];
  66. }
  67. }
  68. --pos;
  69. times1 = poww(K - 1 , (N + 1) / 2 - ind[pos]) * (dp[ind[pos]][0] + dp[ind[pos]][1]) % MOD;
  70. }
  71. else
  72. times1 = K * poww(K - 1 , (N + 1) / 2 - 1) % MOD;
  73. ind.clear();
  74. for(int i = 2 ; i <= N ; i += 2)
  75. if(arr[i] != -1)
  76. ind.push_back(i >> 1);
  77. if(!ind.empty()){
  78. memset(dp , 0 , sizeof(dp));
  79. dp[0][0] = 1;
  80. int pos = 0;
  81. for(int i = 1 ; pos < ind.size() ; ++i)
  82. if(ind[pos] == i){
  83. dp[i][0] = dp[i - 1][0];
  84. if(++pos < ind.size() && arr[ind[pos] * 2] == arr[ind[pos - 1] * 2])
  85. swap(dp[i][0] , dp[i][1]);
  86. }
  87. else{
  88. if(i == 1){
  89. dp[i][0] = K - 1; dp[i][1] = 1;
  90. }
  91. else{
  92. dp[i][0] = (dp[i - 1][0] * (K - 2) + dp[i - 1][1] * (K - 1)) % MOD;
  93. dp[i][1] = dp[i - 1][0];
  94. }
  95. }
  96. --pos;
  97. times2 = poww(K - 1 , N / 2 - ind[pos]) * (dp[ind[pos]][0] + dp[ind[pos]][1]) % MOD;
  98. }
  99. else
  100. times2 = K * poww(K - 1 , N / 2 - 1) % MOD;
  101. cout << times1 * times2 % MOD;
  102. return 0;
  103. }

F. Extending Set of Points

如果你做过eJOI2018 元素周期表,这道题应该不难想到怎么做

对于题目中"\((x_1 , y_1) \in R , (x_1 , y_2) \in R , (x_2 , y_1) \in R , (x_2 , y_2) \neq R\)时将\((x_2,y_2)\)加入点集中"的操作,可以使用并查集描述:

并查集中存\(6 \times 10^5\)个点分别表示行和列,对于一个点\((x,y)\),将第\(x\)行和第\(y\)列在并查集中合并。注意到加入\((x_1 , y_1)(x_1 , y_2)(x_2 , y_1)\)之后,\(x_2\)行和\(y_2\)列就在同一个并查集里了,这就表示\((x_2,y_2)\)成为了点集\(R\)中的一个点。不难得到加完所有点后,答案是所有并查集包含的行数和列数的乘积之和。

注意到要删点,所以使用线段树分治+带撤销并查集做一下就可以了。

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<algorithm>
  4. #include<cstring>
  5. #include<map>
  6. #include<stack>
  7. #include<vector>
  8. //This code is written by Itst
  9. using namespace std;
  10. #define int long long
  11. inline int read(){
  12. int a = 0;
  13. char c = getchar();
  14. bool f = 0;
  15. while(!isdigit(c) && c != EOF){
  16. if(c == '-')
  17. f = 1;
  18. c = getchar();
  19. }
  20. if(c == EOF)
  21. exit(0);
  22. while(isdigit(c)){
  23. a = a * 10 + c - 48;
  24. c = getchar();
  25. }
  26. return f ? -a : a;
  27. }
  28. const int MAXN = 6e5 + 7;
  29. #define PII pair < int , int >
  30. #define st first
  31. #define nd second
  32. map < PII , int > mp;
  33. vector < PII > Edge[MAXN << 2];
  34. int fa[MAXN] , szX[MAXN] , szY[MAXN] , Q , ans;
  35. int find(int x){
  36. return fa[x] == x ? x : find(fa[x]);
  37. }
  38. #define mid ((l + r) >> 1)
  39. #define lch (x << 1)
  40. #define rch (x << 1 | 1)
  41. void addEdge(int x , int l , int r , int L , int R , PII pos){
  42. if(l >= L && r <= R){
  43. Edge[x].push_back(pos);
  44. return;
  45. }
  46. if(mid >= L) addEdge(lch , l , mid , L , R , pos);
  47. if(mid < R) addEdge(rch , mid + 1 , r , L , R , pos);
  48. }
  49. void merge(int x , int y , stack < int > &stk){
  50. x = find(x); y = find(y);
  51. if(x == y) return;
  52. ans -= szX[x] * szY[x] + szX[y] * szY[y];
  53. if(szX[x] + szY[x] < szX[y] + szY[y])
  54. swap(x , y);
  55. fa[y] = x; szY[x] += szY[y]; szX[x] += szX[y];
  56. ans += szX[x] * szY[x];
  57. stk.push(y);
  58. }
  59. void work(int x , int l , int r){
  60. stack < int > stk;
  61. int lastans = ans;
  62. for(auto t : Edge[x])
  63. merge(t.st , t.nd + 300000 , stk);
  64. if(l == r)
  65. printf("%lld " , ans);
  66. else{
  67. work(lch , l , mid);
  68. work(rch , mid + 1 , r);
  69. }
  70. while(!stk.empty()){
  71. int t = stk.top(); stk.pop();
  72. int p = find(t);
  73. szX[p] -= szX[t]; szY[p] -= szY[t];
  74. fa[t] = t;
  75. }
  76. ans = lastans;
  77. }
  78. signed main(){
  79. #ifndef ONLINE_JUDGE
  80. freopen("in","r",stdin);
  81. //freopen("out","w",stdout);
  82. #endif
  83. Q = read();
  84. for(int i = 1 ; i <= Q ; ++i){
  85. int a = read() , b = read();
  86. PII t = PII(a , b);
  87. if(mp.find(t) == mp.end()) mp[t] = i;
  88. else{
  89. addEdge(1 , 1 , Q , mp[t] , i - 1 , t);
  90. mp.erase(mp.find(t));
  91. }
  92. }
  93. for(auto t : mp)
  94. addEdge(1 , 1 , Q , t.second , Q , t.first);
  95. for(int i = 1 ; i <= 3e5 ; ++i)
  96. szX[fa[i] = i] = 1;
  97. for(int i = 3e5 + 1 ; i <= 6e5 ; ++i)
  98. szY[fa[i] = i] = 1;
  99. work(1 , 1 , Q);
  100. return 0;
  101. }

G. Double Tree

考虑转移问题的优先级:我们要求\((u,v)(2 | u , 2|v)\)和\((u,v)(2 \not\mid u , 2 \not\mid v)\)的总经过次数最小,其次总边权最小。

既然两棵树同构,可以把这两棵树拍扁到一起变成一棵树,那么我们需要在这一棵树上经过边数最小,那么经过的显然是两点之间的路径。

上面的问题可以在拍扁的树上树形DP+倍增处理:设\(f_{i,j,k=0/1,l=0/1}\)表示:设从\(i\)开始跳\(2^j\)次方步到达的点为\(x\),那么原图中\((2 \times i + k , 2 \times x + l)\)的最短路是多少。注意上面的\(i,x\)指的是在拍扁的树上的编号。转移类似于矩阵乘法。

注意到转移优先级之后有可能答案不优,因为可能存在某些情况会绕一段路到另一棵树上,边权总和比直接走的边权要小。如果能将所有\((2i - 1 , 2i)\)的边权变为\(2i-1\)到\(2i\)之间的最短路长度,那么上面的情况就会覆盖\((2i - 1 , 2i)\)的边权,在DP过程中就不需要考虑了。

所以最后的问题是如何求出所有\(2i-1\)到\(2i\)的最短路。有一个很精妙的SSSP做法:建\(N+1\)个点编号为\(0\)到\(N\),连边\((0,i,w_{2i-1,2i})\),对于树上存在的边\((i,j,w_1,w_2)\)在图上连\((i,j,w_1+w_2)\),跑Dijkstra,得到\(0\)到\(i\)的最短路长度就是\(2i-1\)到\(2i\)的最短路长度。

  1. #include<iostream>
  2. #include<cstdio>
  3. #include<queue>
  4. #include<cstring>
  5. //This code is written by Itst
  6. using namespace std;
  7. #define int long long
  8. inline int read(){
  9. int a = 0;
  10. char c = getchar();
  11. while(!isdigit(c))
  12. c = getchar();
  13. while(isdigit(c)){
  14. a = a * 10 + c - 48;
  15. c = getchar();
  16. }
  17. return a;
  18. }
  19. const int MAXN = 3e5 + 7;
  20. int N , Q;
  21. struct Edge{int end , upEd , w;};
  22. inline void addEd(Edge *Ed , int *head , int &cntEd , int a , int b , int c , bool f = 0){
  23. Ed[++cntEd] = (Edge){b , head[a] , c};
  24. head[a] = cntEd;
  25. if(f){
  26. Ed[++cntEd] = (Edge){a , head[b] , c};
  27. head[b] = cntEd;
  28. }
  29. }
  30. namespace SSSP{
  31. #define PII pair < int , int >
  32. #define st first
  33. #define nd second
  34. Edge Ed[MAXN << 2];
  35. int head[MAXN] , dis[MAXN];
  36. int cntEd;
  37. priority_queue < PII > q;
  38. void work(){
  39. memset(dis , 0x7f , sizeof(dis));
  40. dis[0] = 0;
  41. q.push(PII(0 , 0));
  42. while(!q.empty()){
  43. PII t = q.top(); q.pop();
  44. if(dis[t.nd] != -t.st) continue;
  45. for(int i = head[t.nd] ; i ; i = Ed[i].upEd)
  46. if(dis[t.nd] + Ed[i].w < dis[Ed[i].end])
  47. q.push(PII(-(dis[Ed[i].end] = dis[t.nd] + Ed[i].w) , Ed[i].end));
  48. }
  49. }
  50. }
  51. namespace Tree{
  52. Edge Ed[MAXN << 1];
  53. struct matrix{
  54. int a[2][2];
  55. matrix(){memset(a , 0x3f , sizeof(a));}
  56. int* operator [](int x){return a[x];}
  57. matrix operator *(matrix b){
  58. matrix c;
  59. for(int i = 0 ; i < 2 ; ++i)
  60. for(int j = 0 ; j < 2 ; ++j)
  61. for(int k = 0 ; k < 2 ; ++k)
  62. c[j][k] = min(c[j][k] , a[j][i] + b[i][k]);
  63. return c;
  64. }
  65. }dis[MAXN][20] , tmp , initial , toX , toY;
  66. int head[MAXN] , dep[MAXN] , fa[MAXN][20] , val2[MAXN << 1] , cntEd;
  67. void dfs(int x , int p , matrix val){
  68. dis[x][0] = val;
  69. fa[x][0] = p;
  70. for(int i = 1 ; fa[x][i - 1] ; ++i){
  71. fa[x][i] = fa[fa[x][i - 1]][i - 1];
  72. dis[x][i] = dis[x][i - 1] * dis[fa[x][i - 1]][i - 1];
  73. }
  74. dep[x] = dep[p] + 1;
  75. for(int i = head[x] ; i ; i = Ed[i].upEd)
  76. if(Ed[i].end != p){
  77. tmp[1][0] = min(Ed[i].w + SSSP::dis[Ed[i].end] , val2[i] + SSSP::dis[x]);
  78. tmp[0][1] = min(val2[i] + SSSP::dis[Ed[i].end] , Ed[i].w + SSSP::dis[x]);
  79. tmp[0][0] = min(Ed[i].w , tmp[0][1] + SSSP::dis[x]);
  80. tmp[1][1] = min(val2[i] , tmp[1][0] + SSSP::dis[x]);
  81. dfs(Ed[i].end , x , tmp);
  82. }
  83. }
  84. void init(){
  85. memset(initial.a , 0 , sizeof(initial));
  86. dfs(1 , 0 , initial);
  87. }
  88. int jump(int x , int y , bool f1 , bool f2){
  89. if(dep[x] < dep[y]){
  90. x ^= y ^= x ^= y;
  91. swap(f1 , f2);
  92. }
  93. toX = initial; toY = initial;
  94. toX[0][1] = toX[1][0] = SSSP::dis[x];
  95. toY[0][1] = toY[1][0] = SSSP::dis[y];
  96. for(int i = 18 ; i >= 0 ; --i)
  97. if(dep[x] - (1 << i) >= dep[y]){
  98. toX = toX * dis[x][i];
  99. x = fa[x][i];
  100. }
  101. if(x == y) return toX[f1][f2];
  102. for(int i = 18 ; i >= 0 ; --i)
  103. if(fa[x][i] != fa[y][i]){
  104. toX = toX * dis[x][i];
  105. toY = toY * dis[y][i];
  106. x = fa[x][i]; y = fa[y][i];
  107. }
  108. toX = toX * dis[x][0]; toY = toY * dis[y][0];
  109. return min(toX[f1][0] + toY[f2][0] , toX[f1][1] + toY[f2][1]);
  110. }
  111. void work(int x , int y){
  112. bool f1 = !(x & 1) , f2 = !(y & 1);
  113. x = (x + 1) >> 1; y = (y + 1) >> 1;
  114. printf("%lld\n" , jump(x , y , f1 , f2));
  115. }
  116. }
  117. signed main(){
  118. #ifndef ONLINE_JUDGE
  119. freopen("in","r",stdin);
  120. freopen("out","w",stdout);
  121. #endif
  122. N = read();
  123. for(int i = 1 ; i <= N ; ++i)
  124. addEd(SSSP::Ed , SSSP::head , SSSP::cntEd , 0 , i , read());
  125. for(int i = 1 ; i < N ; ++i){
  126. int a = read() , b = read() , w1 = read() , w2 = read();
  127. addEd(SSSP::Ed , SSSP::head , SSSP::cntEd , a , b , w1 + w2 , 1);
  128. addEd(Tree::Ed , Tree::head , Tree::cntEd , a , b , w1 , 1);
  129. Tree::val2[Tree::cntEd] = Tree::val2[Tree::cntEd - 1] = w2;
  130. }
  131. SSSP::work(); Tree::init();
  132. for(int Q = read() ; Q ; --Q)
  133. Tree::work(read() , read());
  134. return 0;
  135. }

Educational Codeforces Round 62 (Rated for Div. 2) Solution的更多相关文章

  1. Educational Codeforces Round 62 (Rated for Div. 2)

    A. Detective Book 题意:一个人读书  给出每一章埋的坑在第几页可以填完 . 一个人一天如果不填完坑他就会一直看 问几天能把这本书看完 思路:模拟一下 取一下过程中最大的坑的页数  如 ...

  2. Educational Codeforces Round 62 (Rated for Div. 2) C 贪心 + 优先队列 + 反向处理

    https://codeforces.com/contest/1140/problem/C 题意 每首歌有\(t_i\)和\(b_i\)两个值,最多挑选m首歌,使得sum(\(t_i\))*min(\ ...

  3. Educational Codeforces Round 62 (Rated for Div. 2)C

    题目链接 :C. Playlist #include<bits/stdc++.h> using namespace std; #define maxn 300005 #define LL ...

  4. Educational Codeforces Round 62 (Rated for Div. 2) - C Playlist

    当时题意看错了...不过大致思路是对的,唯一没有想到的就是用优先队列搞这个东西,真是不该啊... 题意大概就是,有N首歌,N首歌有两个东西,一个是长度Ti,一个是美丽值Bi,你最多可以选择K首歌, 这 ...

  5. C. Playlist Educational Codeforces Round 62 (Rated for Div. 2) 贪心+优先队列

    C. Playlist time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...

  6. Educational Codeforces Round 62 (Rated for Div. 2)E(染色DP,构造,思维,组合数学)

    #include<bits/stdc++.h>using namespace std;const long long mod=998244353;long long f[200007][2 ...

  7. Educational Codeforces Round 40 (Rated for Div. 2) Solution

    从这里开始 小结 题目列表 Problem A Diagonal Walking Problem B String Typing Problem C Matrix Walk Problem D Fig ...

  8. Educational Codeforces Round 54 (Rated for Div. 2) Solution

    A - Minimizing the String solved 题意:给出一个字符串,可以移掉最多一个字符,在所有可能性中选取一个字典序最小的. 思路:显然,一定可以移掉一个字符,如果移掉的字符的后 ...

  9. Educational Codeforces Round 55 (Rated for Div. 2) Solution

    A. Vasya and Book Solved. 三种方式取$Min$ #include <bits/stdc++.h> using namespace std; #define ll ...

随机推荐

  1. [解决方案]SystemError: Parent module '' not loaded, cannot perform relative import的解决方案

    缺陷:__mian__不能使用相对导入 PEP 328 Relative Imports and __name__ 中说明: Relative imports use a module's __nam ...

  2. 异常处理器详解 Java多线程异常处理机制 多线程中篇(四)

    在Thread中有异常处理器相关的方法 在ThreadGroup中也有相关的异常处理方法 示例 未检查异常 对于未检查异常,将会直接宕掉,主线程则继续运行,程序会继续运行 在主线程中能不能捕获呢? 我 ...

  3. mybatis-generator自动生成代码插件使用详解

    mybatis-generator是一款在使用mybatis框架时,自动生成model,dao和mapper的工具,很大程度上减少了业务开发人员的手动编码时间,今天自己研究了一下,也分享一下使用心得供 ...

  4. 第33章 密码学(Cryptography),密钥(Keys)和HTTPS - Identity Server 4 中文文档(v1.0.0)

    IdentityServer依赖于几个加密机制来完成它的工作. 33.1 令牌签名和验证 IdentityServer需要非对称密钥对来签署和验证JWT.此密钥对可以是证书/私钥组合或原始RSA密钥. ...

  5. mock测试

    看到群里有人说mock测试,究竟什么是mock测试呢?开始自己也没明白,查了下相关资料.还是很有必要了解哈:那么mock测试能解决什么问题?mock测试要如何做呢?今天为大家做简单介绍.mock测试就 ...

  6. Spring boot入门(二):Spring boot集成MySql,Mybatis和PageHelper插件

    上一篇文章,写了如何搭建一个简单的Spring boot项目,本篇是接着上一篇文章写得:Spring boot入门:快速搭建Spring boot项目(一),主要是spring boot集成mybat ...

  7. 为什么AI的翻译水平还远不能和人类相比?

    为什么AI的翻译水平还远不能和人类相比? https://mp.weixin.qq.com/s/0koIt-qu9IOVxNhbFcZr1Q 作者 | SHARON ZHOU 译者 | 王天宇 编辑 ...

  8. ubuntu16.04 部署配置LVS主从

    实验环境---ubuntu16.04 四台机器:10.211.55.13—55.16 具体实验环境配置如下: 10.211.55.102  LVS_VIP 10.211.55.13  LVS_MAST ...

  9. ListView展示不同布局需要注意的地方

    尊重劳动成果,转载请标明出处:http://www.cnblogs.com/tangZH/p/8419010.html 我们在项目中经常需在一个listview中展示不一样的布局,我们可以在adapt ...

  10. ASP.NET Core 入门教程 10、ASP.NET Core 日志记录(NLog)入门

    一.前言 1.本教程主要内容 ASP.NET Core + 内置日志组件记录控制台日志 ASP.NET Core + NLog 按天记录本地日志 ASP.NET Core + NLog 将日志按自定义 ...