Submission #812247

# Submission time Handle Problem Language Result Execution time Memory
812247 2023-08-07T07:59:58 Z MyCode Inside information (BOI21_servers) C++17
0 / 100
17 ms 924 KB
#include <bits/stdc++.h>

using namespace std;

#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int n, k;
    cin >> n >> k;
    int pos[n + 1], cur = 0;
    for (int i = 1; i <= n; i++)
        pos[i] = -1;
    for (int q = 0; q < n + k - 1; q++) {
        char t;
        cin >> t;
        if (t == 'S') {
            int a, b;
            cin >> a >> b;
            if (a != 1)swap(a, b);
            pos[b] = q;
            cur++;
        } else if (t == 'Q') {
            int a, b;
            cin >> a >> b;
            if (pos[a] > pos[b])
                cout << "Yes\n";
            else
                cout << "No\n";
        } else {
            int d;
            cin >> d;
            if (pos[d] == -1)cout << "1\n";
            else cout << 1 + cur - pos[d] + 1 << "\n";
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 716 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 716 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 924 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 924 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 724 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 764 KB Output isn't correct
2 Halted 0 ms 0 KB -