Submission #1003829

# Submission time Handle Problem Language Result Execution time Memory
1003829 2024-06-20T18:37:43 Z vjudge1 Zagrade (COI20_zagrade) C++17
0 / 100
1071 ms 416 KB
#include <bits/stdc++.h>

using namespace std;

int marc[1005];

int main(){
	int n,q; cin>>n>>q;
	for(int i = 1; i <= n; i++){
		if(marc[i])continue;
		for(int j = i+1; j <= n; j++)
			if(!marc[j]){
				cout<<"? "<<i<<" "<<j<<endl;
				int x; cin>>x;
				if(x){
					marc[j] = 1;
					break;
				}
			}
	}
	cout<<"! ";
	for(int i = 1; i <= n; i++){
		if(marc[i] == 0)cout<<"(";
		else cout<<")";
	}cout<<endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 18 ms 344 KB Output is correct
4 Correct 33 ms 344 KB Output is correct
5 Correct 87 ms 344 KB Output is correct
6 Correct 100 ms 344 KB Output is correct
7 Runtime error 1071 ms 416 KB Execution killed with signal 13
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Mismatch at position 1. Expected ), found (
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 344 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -