QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#65167#4663. Arithmetics GameT3alaadl3k2olyehymn3k#RE 0ms0kbC++201.0kb2022-11-27 21:45:042022-11-27 21:45:04

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:45:04]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2022-11-27 21:45:04]
  • 提交

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

result: