Submission #446870

#TimeUsernameProblemLanguageResultExecution timeMemory
446870wiwihoInside information (BOI21_servers)C++14
2.50 / 100
218 ms524292 KiB
#include <bits/stdc++.h> #define eb emplace_back using namespace std; typedef long long ll; const int SZ = 120000; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector<bitset<SZ>> b(n + 1); for(int i = 1; i <= n; i++) b[i].set(i); int q = n + k - 1; while(q--){ string s; cin >> s; assert(s != "C"); if(s == "S"){ int u, v; cin >> u >> v; b[u] |= b[v]; b[v] |= b[u]; continue; } int v, c; cin >> v >> c; if(b[v][c]) cout << "yes\n"; else cout << "no\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...