This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
long long n, m, x, y;
char c;
bool check[201];
int main()
{
cin >> n >> m;
while(m--)
{
cin >> c;
if(c == 'S')
{
cin >> x;
check[x] = 1 - check[x];
}
else
{
cin >> x >> y;
bool chk = 0;
for(int i = x; i <= y; ++i)
{
for(int j = i + 1; j <= y; ++j)
{
if(check[i] && check[j] && __gcd(i, j) > 1)
{
chk = 1;
break;
}
}
if(chk) break;
}
if(!chk) cout << "NE\n";
else cout << "DA\n";
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |