# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1011404 | 2024-06-30T13:11:26 Z | vannnnnnnn | Zagrade (COI20_zagrade) | C++14 | 540 ms | 344 KB |
#include<bits/stdc++.h> using namespace std; int main() { int n, q; scanf("%d %d", &n, &q); char s[n+5]; s[0]='('; for(int i=0; i<n-1; i++) { printf("? %d %d\n", i+1, i+2); fflush(stdout); int ans; scanf("%d", &ans); if(ans==1) { if(s[i]=='(') { s[i+1]=')'; } } else { if(s[i]=='(') { s[i+1]='('; } else { s[i+1]=')'; } } } printf("! "); for(int i=0; i<n; i++) { printf("%c", s[i]); } printf("\n"); fflush(stdout); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 4 ms | 344 KB | Answer length should be 1000, but it is 593 |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Mismatch at position 1. Expected ), found ( |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Incorrect | 540 ms | 344 KB | Answer length should be 100000, but it is 95475 |
3 | 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 | - |