QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#65167 | #4663. Arithmetics Game | T3alaadl3k2olyehymn3k# | RE | 0ms | 0kb | C++20 | 1.0kb | 2022-11-27 21:45:04 | 2022-11-27 21:45:04 |
Judging History
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, t;
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;
}
详细
Test #1:
score: 0
Interactor Dangerous Syscalls
input:
2 2
output:
0