#include <bits/stdc++.h>
using namespace std;
int n, q, a[105];
int main(){
cin >> n >> q;
for(int i = 0; i < n; i++){
char op; cin >> op;
if(op == 'S'){
int x; cin >> x; a[x] = 1 - a[x];
}else{
int x, y; cin >> x >> y;
bool ans = false;
for(int i = x; i <= y; i++){
for(int j = i + 1; j <= y; j++){
if(a[i] && a[j] && (__gcd(i, j) >= 1)){
ans = true; break;
}
}
if(ans) break;
}
if(ans) cout << "DA\n"; else cout << "NE\n";
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
352 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
348 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
352 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |