結果
| 問題 |
No.1790 Subtree Deletion
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2021-12-11 14:51:54 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 807 bytes |
| コンパイル時間 | 1,970 ms |
| コンパイル使用メモリ | 107,620 KB |
| 最終ジャッジ日時 | 2025-01-26 07:48:15 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 12 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(n); i++)
int main() {
int N; cin >> N;
u64 all_XOR_for_imput = 0;
rep(i,N-1){
int u,v; u64 a;
cin >> u >> v >> a;
all_XOR_for_imput ^= u;
all_XOR_for_imput ^= v;
all_XOR_for_imput ^= a;
}
int Q; cin >> Q;
rep(i,Q){
int t,x; cin >> t >> x;
all_XOR_for_imput ^= t;
all_XOR_for_imput ^= x;
}
cout << all_XOR_for_imput << endl;
return 0;
}
/*
struct ios_do_not_sync{
ios_do_not_sync(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
}
} ios_do_not_sync_instance;
*/
Nachia