Submission #773501

#TimeUsernameProblemLanguageResultExecution timeMemory
773501blacktulipZagrade (COI20_zagrade)C++17
0 / 100
694 ms856 KiB
#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 (stderr)

zagrade.cpp: In function 'int main()':
zagrade.cpp:33:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |  scanf("%d %d",&n,&t);
      |  ~~~~~^~~~~~~~~~~~~~~
zagrade.cpp:38:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |   scanf("%d",&a[i]);
      |   ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...