# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
899443 |
2024-01-06T07:46:27 Z |
HamzaT |
Radio (COCI22_radio) |
C++14 |
|
1500 ms |
1444 KB |
//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=0;
for(int i=l;i<=r;i++)
{
for(int j=i+1;j<=r;j++)
{
if(a[j]==1&&a[i]==1&&__gcd(j,i)!=1){ok=1;break;}
}
if(ok){break;}
}
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 time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1536 ms |
1444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Execution timed out |
1536 ms |
1444 KB |
Time limit exceeded |
9 |
Halted |
0 ms |
0 KB |
- |