| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1281228 | arman.khachatryan | Klasika (COCI20_klasika) | C++20 | 2987 ms | 4556 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll Q;
cin >> Q;
vector<ll> xorToRoot(Q + 2);
xorToRoot[1] = 0;
vector<ll> nodes;
nodes.push_back(0);
ll nodeCount = 1;
while (Q--) {
string type;
cin >> type;
if (type == "Add") {
ll x, y;
cin >> x >> y;
nodeCount++;
xorToRoot[nodeCount] = xorToRoot[x] ^ y;
nodes.push_back(xorToRoot[nodeCount]);
} else {
ll a, b;
cin >> a >> b;
ll ans = 0;
for (ll val : nodes) {
ans = max(ans, xorToRoot[a] ^ val);
}
cout << ans << "\n";
}
}
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
