Submission #799935

# Submission time Handle Problem Language Result Execution time Memory
799935 2023-08-01T08:35:55 Z tlnk07 Radio (COCI22_radio) C++17
10 / 110
1 ms 468 KB
#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
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 296 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Runtime error 1 ms 468 KB Execution killed with signal 11
9 Halted 0 ms 0 KB -