Submission #555085

# Submission time Handle Problem Language Result Execution time Memory
555085 2022-04-30T06:55:40 Z fuad27 Radio (COCI22_radio) C++17
10 / 110
2 ms 212 KB
#include<bits/stdc++.h>
using namespace std;
int main () {
	int n, q;
	cin >> n >> q;
	if(n <= 100 and q <= 200) {
		vector<int> v(n+1);
		while(q--) {
			char c;
			cin >> c;
			if(c == 'S') {
				long long in;
				cin >> in;
				v[in] ^= 1;
			}
			else if(c == 'C') {
				long long l, r;
				cin >> l >> r;
				bool check = false;
				for(int i =l;i<=r;i++) {
					for(int j = l;j<=r;j++) {
						if(j == i)continue;
						if(!v[j] or !v[i])continue;
						if(__gcd(i, j)!=1) {
							check = true;
						}
					}
				}
				cout << (check?"DA":"NE") << "\n";
			}
		}
	}
	else {
		
	}
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 2 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 2 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 0 ms 212 KB Output isn't correct
9 Halted 0 ms 0 KB -