版本比较
4.3周五下午--东塘--蒋
正文
增加 24 行删除 24 行
14 行未改动151617181919202122232425252627282930313233343535363738398 行未改动484950515252535455569 行未改动6667686970707172737273747576777879808182838283848586873 行未改动919293949595969798991001011021031041051051061071081081091101111121131141151161171181181191201211222 行未改动1251261271281291291301311321333 行未改动1371381391401411411421431441451461471481481491501511521531541551551561571581591601611611621631641641651661671682 行未改动17117217317417517517617717817817918018118215 行未改动1981992002012022022032042052062072082082092102112129 行未改动22222322422522622622722822923013 行未改动14 行未改动
int main(){ cin >> n;
for(int i = 1; i <= n; i++) { cin >> a[i]; } sort(a + 1, a + 1 + n);
for(int i = 1; i <= n; i++) { if(v[a[i]] == 0) { v[a[i]] = 1; b[++m] = a[i]; } t[a[i]]++; }
for(int i = 1; i <= m; i++) { cout << b[i] << " " << t[b[i]] << "\n"; }8 行未改动2. ### 直到大于五次时 ,就判断字符有没有出现过 ,如果没有就标记成有 ,并让答案加一。## 代码:```cpp#include<bits/stdc++.h>// //using namespace std;
int cnt;char a[10][10];9 行未改动 { vis[s] = 1; cnt++; }
return ; } }
for(int i = 0; i < 4; i++) { int nx = dx[i] + x, ny = dy[i] + y; if(nx >= 1 && nx <= 5 && ny >= 1 && ny <= 5) { dfs(o + 1, nx, ny, s + a[nx][ny]); } } return ;
return ;}
int main(){3 行未改动 { cin >> a[i][j]; } }
for(int i = 1; i <= 5; i++) { for(int j = 1; j <= 5; j++) { string s; s += a[i][j]; dfs(1, i, j, s); } }
cout << cnt; return 0;} }```# [T748207 [COCI 2010/2011 #3] ZNANSTVENIK](https://www.luogu.com.cn/problem/T748207?contestId=319118)## 错误原因:### 题意理解错了 ,以为可以随便删 。## 思路:1. ### 我们可以从最后一行枚举 。先假设这行要保留 ,然后判断如果满足要求就跳出循环输出 $n$ 减去要保留的几行 。## 代码:```cpp#include<bits/stdc++.h>// //using namespace std;
int n, m;bool v[1005];2 行未改动
bool check(){ vis.clear();
for(int i = 1; i <= m; i++) { string s = ""; for(int j = n; j >= 1; j--)3 行未改动 continue; } s += a[j][i]; }
if(vis[s] == 1) { return 0; } vis[s] = 1; }
return 1;}
int main(){ cin >> n >> m;
for(int i = 1; i <= n; i++) { for(int j = 1; j <= m; j++) { cin >> a[i][j]; } } v[i] = 1; }
int cnt = 0; for(int i = n; i >= 1; i--) { cnt++;2 行未改动 { break; } }
cout << n - cnt; return 0;} }```# [T748209 鬼子进村](https://www.luogu.com.cn/problem/T748209?contestId=319118)## 错误原因:### 没看清楚题 ,以为是最后统一判断 。15 行未改动{ cin >> n >> m; se.insert(0); se.insert(n + 1);
while(m--) { char op; int x; cin >> op;
if(op == 'D') { cin >> x; se.insert(x);9 行未改动 else if(op == 'Q') { cin >> x; auto it = se.lower_bound(x);
if(*it == x) { cout << "0\n"; }13 行未改动