제출 #689814

#제출 시각아이디문제언어결과실행 시간메모리
689814TomitaMateiTable Tennis (info1cup20_tabletennis)C++14
49 / 100
205 ms468 KiB
#include <iostream> #include <algorithm> using namespace std; int n,k,i,j,i1,j2,t,dr,st,s,nr,v[16000],r[16000],ok,x; int main() { cin>>n>>k; x=n+k; for (i=1; i<=x; i++) cin>>v[i]; sort (v+1,v+x+1); for (st=1; st<=k+1; st++) for (dr=n+k; dr>=n+st-1; dr--) { i=st; j=dr; s=v[i]+v[j]; nr=1; r[1]=v[i]; r[n-nr+1]=v[j]; i++; j--; ok=0; if (nr*2==n) { for (i=1; i<=n; i++) cout<<r[i]<<" "; return 0; } while (i<j) { for (j2=j; j2>i; j2--) if (s==v[i]+v[j2]) { nr++; r[n-nr+1]=v[j2]; r[nr]=v[i]; ok=1; break; } if (nr*2==n) { for (i=1; i<=n; i++) cout<<r[i]<<" "; return 0; } if (ok==0) i++; else { ok=0; i++; j=j2-1; } } } return 0; }

컴파일 시 표준 에러 (stderr) 메시지

tabletennis.cpp: In function 'int main()':
tabletennis.cpp:10:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   10 |     for (i=1; i<=x; i++)
      |     ^~~
tabletennis.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   12 |         sort (v+1,v+x+1);
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...