| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362020 | SulA | Inside information (BOI21_servers) | C++20 | 119 ms | 1428 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;
tim[1] = 676767676;
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 (min(a, b) == 1)
cout << (tim[max(a, b)] > 0 ? "yes" : "no");
else
cout << (a == b || 0 < tim[b] && tim[b] < tim[a] ? "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... | ||||
