제출 #73727

#제출 시각아이디문제언어결과실행 시간메모리
73727FLDutchman마상시합 토너먼트 (IOI12_tournament)C++14
0 / 100
1056 ms2308 KiB
#include <bits/stdc++.h> using namespace std; typedef int INT; #define pb push_back #define fst first #define snd second #define FOR(i,l,r) for(int i = (l); i < (r); i++) typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int,int> ii; typedef vector<ii> vii; vii intervals; vii idx; INT GetBestPosition(INT N, INT C, INT R, INT *K, INT *S, INT *E) { idx.resize(N); FOR(i, 0, N) idx[i] = {i,i}; FOR(i, 0, C){ intervals.pb({idx[S[i]].fst, idx[E[i]].snd}); idx.erase(idx.begin() +S[i], idx.begin() + E[i]); idx[S[i]].fst = intervals.back().fst; } //for(ii p : intervals) cout << p.fst << " " << p.snd << endl; vi val(C, -1); FOR(i, 0, C) FOR(j, intervals[i].fst, intervals[i].snd){ val[i] = max(val[i], K[j]); } int best = 0; //for(int k : val) cout << k << endl; FOR(i, 0, N) { int tot = 0; FOR(c,0,C) if(intervals[c].fst <= i and i < intervals[c].snd){ tot += val[c] < R; } best = max(best, tot); } return best; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...