# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1011414 | 2024-06-30T13:20:04 Z | vannnnnnnn | Zagrade (COI20_zagrade) | C++14 | 585 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[1]='('; for(int i=1; i<n; i++) { printf("? %d %d\n", i, i+1); fflush(stdout); int ans; scanf("%d", &ans); if(ans==1) { s[i]='('; s[i+1]=')'; } else { if(s[i]=='(') { s[i+1]='('; } else { s[i+1]=')'; } } } printf("! "); for(int i=1; i<=n; i++) { printf("%c", s[i]); } printf("\n"); fflush(stdout); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 3 ms | 344 KB | Output is correct |
3 | Incorrect | 4 ms | 344 KB | Mismatch at position 12. Expected (, found ) |
4 | 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 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 518 ms | 344 KB | Output is correct |
3 | Incorrect | 585 ms | 344 KB | Mismatch at position 19. Expected (, found ) |
4 | 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 | - |