Submission #555211

#TimeUsernameProblemLanguageResultExecution timeMemory
555211BT21tataRadio (COCI22_radio)C++17
10 / 110
1 ms468 KiB
#include<bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // using namespace __gnu_pbds; // #pragma GCC target ("avx,avx2,fma") // #pragma GCC optimize("Ofast") // #pragma GCC optimize("unroll-loops") typedef long long ll; typedef long double ld; typedef unsigned long long ull; #define SPEED ios_base::sync_with_stdio(false); cin.tie(0), cout.tie(0) #define rall(v) (v).rbegin(),(v).rend() #define all(v) (v).begin(),(v).end() #define setp fixed<<setprecision #define OK cerr<<"OK"<<endl<<flush #define pii pair<int, int> #define pll pair<ll, ll> #define pb push_back #define F first #define S second #define y0 jahdakdh #define y1 jahsadakdakdh #define endl '\n' const ll MOD=1e9+7; const ll mod=(1ll<<31)-1; const ld eps=1e-8; using namespace std; mt19937 rng(std::chrono::system_clock::now().time_since_epoch().count()); int n, Q; bool a[104]; int main() { SPEED; cin>>n>>Q; while(Q--) { char q; cin>>q; if(q=='S') { int x; cin>>x; a[x]=!a[x]; } else { bool f=1; int l, r; cin>>l>>r; for(int i=l; i<=r; i++) { for(int j=i+1; j<=r; j++) { if(a[i] and a[j] and __gcd(i, j)!=1) { //cout<<i<<' '<<j<<endl; f=0; } } } cout<<(f? "NE\n":"DA\n"); } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...