| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362018 | SulA | Inside information (BOI21_servers) | C++20 | 77 ms | 820 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N = 120'001;
int tim[N];
int main() {
int n,k; cin >> n >> k;
int z = 0;
for (int _ = 0; _ < n+k-1; _++) {
char t;
int a,b; cin >> t;
if (t == 'S') {
cin >> a >> b;
if (b == 1) swap(a, b);
tim[b] = ++z;
} else if (t == 'Q') {
cin >> a >> b;
if (a == 1)
cout << (tim[b] > 0 ? "yes" : "no");
else
cout << (tim[a] < tim[b] ? "yes" : "no");
cout << "\n";
} else {
cin >> b;
if (b == 1) cout << z+1 << "\n";
else cout << (tim[b] == 0 ? 1 : 2 + z - tim[b]) << "\n";
}
}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
