Submission #1003828

# Submission time Handle Problem Language Result Execution time Memory
1003828 2024-06-20T18:34:19 Z vjudge1 Zagrade (COI20_zagrade) C++17
0 / 100
1159 ms 412 KB
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 1005;
int marc[MAXN];

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 3 ms 344 KB Output is correct
3 Correct 30 ms 344 KB Output is correct
4 Correct 24 ms 344 KB Output is correct
5 Correct 109 ms 344 KB Output is correct
6 Correct 83 ms 344 KB Output is correct
7 Runtime error 1159 ms 412 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 -