QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65168#4663. Arithmetics GameT3alaadl3k2olyehymn3k#RE 0ms0kbC++201.1kb2022-11-27 21:46:452022-11-27 21:46:46

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

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


result: