# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
773500 | 2023-07-05T06:11:15 Z | vjudge1 | Zagrade (COI20_zagrade) | C++17 | 572 ms | 1044 KB |
#include <bits/stdc++.h> using namespace std; typedef long long lo; #define fi first #define se second #define endl "\n" #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) #define mid ((start+end)/2) #define ort ((bas+son)/2) const lo inf = 1000000000; const lo li = 500005; const lo mod = 1000000007; int n,m,a[li],k,flag,t; int cev; string s; vector<int> v; char b[li]; inline int in(){ int x; cin>>x; return x; } int main(void){ scanf("%d %d",&n,&t); FOR b[i]='_'; for(int i=1;i<n;i++){ printf("? %d %d\n",i,i+1); fflush(stdout); scanf("%d",&a[i]); if(a[i]==1){b[i]='(';b[i+1]=')';} } int emp=0; FOR{ if(b[i]=='_'){ emp++; } } int tmp=0; FOR{ if(b[i]=='_' && tmp<emp/2){tmp++;b[i]='(';} else if(b[i]=='_') b[i]=')'; } printf("! "); FOR printf("%c",b[i]); printf("\n"); fflush(stdout); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 7 ms | 208 KB | Output is correct |
3 | Incorrect | 6 ms | 208 KB | Mismatch at position 10. Expected ), found ( |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | Mismatch at position 1. Expected ), found ( |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Output is correct |
2 | Correct | 572 ms | 1044 KB | Output is correct |
3 | Incorrect | 469 ms | 780 KB | Mismatch at position 16. Expected ), found ( |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 208 KB | Mismatch at position 1. Expected ), found ( |
2 | Halted | 0 ms | 0 KB | - |