QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#65166 | #4663. Arithmetics Game | T3alaadl3k2olyehymn3k# | Compile Error | / | / | C++20 | 1.0kb | 2022-11-27 21:44:09 | 2022-11-27 21:44:11 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2022-11-27 21:44:11]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2022-11-27 21:44:09]
- 提交
answer
#include "bits/stdc++.h"
using namespace std;
void solve() {
int n;
cin >> n;
set<int> nums;
for (int i = 1; i <= 2 * n; i++)
nums.insert(i);
for (int i = 1; i < n; i++) {
int x;
cin >> x;
nums.erase(x);
if (x % 2) {
nums.erase(x + 1);
cout << x + 1 << endl;
} else {
nums.erase(x - 2);
cout << x - 2 << endl;
}
}
// for (auto i: nums)cout << i << ' ';
}
string s;
int main() {
// ios::sync_with_stdio(false);
// cout.tie(nullptr);
// cin.tie(nullptr);
solve();
exit(0);
cin >> s >> t;
int i = 0, current = 0, ans = (int) s.size();
for (char c: t) {
while (i < s.size() and s[i] > c) {
++current;
++i;
}
if (s[i] < c) {
ans = min(ans, current);
break;
}
ans = min(ans, current + (int) s.size() - i);
}
cout << ans << '\n';
return 0;
}
詳細信息
answer.code: In function ‘int main()’: answer.code:34:17: error: ‘t’ was not declared in this scope; did you mean ‘tm’? 34 | cin >> s >> t; | ^ | tm