Submission #555083

# Submission time Handle Problem Language Result Execution time Memory
555083 2022-04-30T06:53:47 Z fuad27 Radio (COCI22_radio) C++17
0 / 110
1 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<bool> v(n+1);
		while(q--) {
			char c;
			cin >> c;
			if(c == 'S') {
				long long in;
				cin >> in;
				v[in] = true;
			}
			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 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 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 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -