Submission #899449

#TimeUsernameProblemLanguageResultExecution timeMemory
899449HamzaTRadio (COCI22_radio)C++14
0 / 110
1558 ms1364 KiB
//struct Edge {int u, v, weight;bool operator<(Edge const& other) {return weight < other.weight;}}; #include <bits/stdc++.h> #define endl "\n" #define ll long long #define sp ' ' #define pb push_back #define ar for(int i=1;i<=n;i++) using namespace std; ll t=1; const ll N=3e5+100; ll n,m,q,k; ll a[N],b[N],c[N]; void solve() { cin>>n>>m; while(m--) { char c; cin>>c; if(c=='S'){ll x;cin>>x;a[x]=abs(a[x]-1);} else { ll l,r;cin>>l>>r; bool ok=false; for(ll i=2;i*i<=n;i++) { ll num=0; for(int j=i;j<=n;j+=i){if(a[j]&&j>=l&&j<=r){num++;}} if(num>=2){ok=true;} } if(ok){cout<<"DA"<<endl;} else{cout<<"NE"<<endl;} } } return; } int main() { //freopen("shell.in", "r", stdin); // freopen("shell.out", "w", stdout); ios::sync_with_stdio(NULL); cin.tie(NULL);cout.tie(NULL); // cin>>t; while(t--){solve();} return 0; } //09:00 :: 9:45 //10:30 ::
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...