제출 #100509

#제출 시각아이디문제언어결과실행 시간메모리
100509figter001마상시합 토너먼트 (IOI12_tournament)C++17
0 / 100
1069 ms2228 KiB
// #include "grader.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef unsigned long long ull; int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { vector<int> r,tmp,nxt; for(int i=0;i<N-1;i++){ r.push_back(K[i]); } int ans = 0; for(int i=0;i<N ;i++){ int cur = 0; tmp = r; tmp.insert(tmp.begin() + i,R); for(int j=0;j<C;j++){ nxt.clear(); int l = S[j]; int r = E[j]; int mx = -1; for(int x=0;x<tmp.size();x++){ if(x >= l && x <= r){ mx = max(mx,tmp[x]); }else{ if(x == r + 1){ nxt.push_back(mx); if(mx == R) cur++; mx = -1; } nxt.push_back(tmp[x]); } } if(mx != -1){ nxt.push_back(mx); if(mx == R) cur++; } tmp = nxt; } ans = max(ans,cur); } return ans; }

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

tournament.cpp: In function 'int GetBestPosition(int, int, int, int*, int*, int*)':
tournament.cpp:25:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int x=0;x<tmp.size();x++){
                ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...