Submission #555085

#TimeUsernameProblemLanguageResultExecution timeMemory
555085fuad27Radio (COCI22_radio)C++17
10 / 110
2 ms212 KiB
#include<bits/stdc++.h> using namespace std; int main () { int n, q; cin >> n >> q; if(n <= 100 and q <= 200) { vector<int> v(n+1); while(q--) { char c; cin >> c; if(c == 'S') { long long in; cin >> in; v[in] ^= 1; } else if(c == 'C') { long long l, r; cin >> l >> r; bool check = false; for(int i =l;i<=r;i++) { for(int j = l;j<=r;j++) { if(j == i)continue; if(!v[j] or !v[i])continue; if(__gcd(i, j)!=1) { check = true; } } } cout << (check?"DA":"NE") << "\n"; } } } else { } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...