QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#65168 | #4663. Arithmetics Game | T3alaadl3k2olyehymn3k# | RE | 0ms | 0kb | C++20 | 1.1kb | 2022-11-27 21:46:45 | 2022-11-27 21:46:46 |
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;
}
cout << 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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Interactor Dangerous Syscalls
input:
2 2
output:
0