Submission #800244

# Submission time Handle Problem Language Result Execution time Memory
800244 2023-08-01T12:42:43 Z Tunglam07 Radio (COCI22_radio) C++17
0 / 110
1 ms 468 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t,s;
	bool ck[t+1],ckgcd=0;
	cin >> t >> s;
	while(s--)
	{
		int n;
		string s;
		cin >> s;
		if(s[0] == 'S')
		{
			cin >> n;
			if(ck[n]==1)
			{
				ck[n]=0;
			}
			else
			{
				ck[n]=1;
			}
		}
		else 
		{
			int l,r;
			cin >> l >> r;
			ckgcd=0;
			for(int i=l;i<=r;i++)
			{
				for(int j=i+1;j<=r;j++)
				{
					if(ck[i]==1 && ck[j]==1 && __gcd(i,j)>1)
					{
						ckgcd=1;
						break;
					}
				}
				if(ckgcd==1)
				{
					break;
				}
			}	
			if(ckgcd==1)
			{
				cout << "DA" << endl;
			}
			else
			{
				cout << "NE" << endl;
			}
		}
		
	}
}
# 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 Runtime error 1 ms 468 KB Execution killed with signal 11
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 -