제출 #31105

#제출 시각아이디문제언어결과실행 시간메모리
31105h0ngjun7마상시합 토너먼트 (IOI12_tournament)C++14
17 / 100
1000 ms2436 KiB
#include <bits/stdc++.h> using namespace std; int k[5010]; int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { int i, j, l, c, mx, idx, dap = 0, cnt = 0, hap = 0, ret = 0; for(c=0;c<=N-1;c++){ cnt = 0; for(i=0;i<N-1;i++){ k[i] = K[i]; } for(i=N-1;i>=c+1;i--){ k[i] = k[i-1]; } k[c] = R; hap = 0; for(j=0;j<C;j++){ mx = -1; for(l=S[j];l<=E[j];l++){ if(mx<k[l]){ mx = k[l]; idx = l; } } if(mx == R) cnt++; k[S[j]] = mx; for(l=E[j]+1;l<=N-1-hap;l++){ k[l-E[j]+S[j]] = k[l]; } hap = hap+(E[j]-S[j]); } if(dap<cnt){ dap = cnt; ret = c; } } return ret; }

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

tournament.cpp: In function 'int GetBestPosition(int, int, int, int*, int*, int*)':
tournament.cpp:7:25: warning: variable 'idx' set but not used [-Wunused-but-set-variable]
     int i, j, l, c, mx, idx, dap = 0, cnt = 0, hap = 0, ret = 0;
                         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...