Submission #744261

#TimeUsernameProblemLanguageResultExecution timeMemory
744261saayan007Game (APIO22_game)C++17
2 / 100
6 ms208 KiB
#include "bits/stdc++.h" using namespace std; #define fr first #define sc second const char nl = '\n'; #include "game.h" const int N = 301; bitset<N> r[N]; int n, k; void init(int _n, int _k) { for(int i = 0; i < N; ++i) { for(int j = 0; j < N; ++j) r[i][j] = 0; } n = _n; k = _k; for(int i = 0; i < k - 1; ++i) { for(int j = i + 1; j < k ; ++j) { r[i][j] = 1; } } } int add_teleporter(int u, int v) { r[u][v] = 1; r[u] = r[u] | r[v]; for(int i = 0; i < n; ++i) { if(r[i][u]) r[i] = r[i] | r[v]; } /* for(int i = 0; i < n; ++i) { */ /* for(int j = 0; j < n; ++j) cout << r[i][j]; */ /* cout << nl; */ /* } */ /* cout << nl; */ for(int i = 0; i < k; ++i) { for(int j = 0; j < n; ++j) { if(r[i][j] && r[j][i]) return 1; } } 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...