Submission #555115

#TimeUsernameProblemLanguageResultExecution timeMemory
555115FidanRadio (COCI22_radio)C++17
10 / 110
1585 ms212 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, q; cin>>n>>q; vector<bool> v(n+1, false); while(q--){ char c; cin>>c; if(c=='S'){ ll k; cin>>k; v[k]=(!v[k]); } else { ll l, r; cin>>l>>r; bool f=false; for(ll i=l; i<r; i++){ if(v[i]){ for(ll j=i+1; j<=r; j++){ if(v[j]){ if(__gcd(i, j)>1){ f=true; break; } } } } } if(f)cout<<"DA"<<endl; else cout<<"NE"<<endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...