| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 363082 | casperwang | 마상시합 토너먼트 (IOI12_tournament) | C++14 | 1097 ms | 1384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pb emplace_back
#define pii pair<int,int>
#define ff first
#define ss second
using namespace std;
#define debug(args...) kout("[ " + string(#args) + " ]", args)
void kout() { cerr << endl; }
template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); }
template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; }
int solve(int id, int N, int C, int R, int *K, int *S, int *E) {
vector <int> now;
for (int i = 0; i+1 < N; i++) {
if (now.size() == id) now.pb(R);
now.pb(K[i]);
}
if (now.size() == id) now.pb(R);
vector <int> tmp;
int cnt = 0;
for (int i = 0; i < C; i++) {
pii mmax = pii(-1, -1);
bool flag = false;
for (int j = S[i]; j <= E[i]; j++) {
mmax = max(mmax, pii(now[j], j));
flag |= (now[j] == R);
}
if (mmax.ff == R) cnt++;
else if (flag) return cnt;
for (int j = 0; j < now.size(); j++)
if (j < S[i] || j > E[i] || j == mmax.ss)
tmp.pb(now[j]);
now = tmp; tmp.clear();
}
return cnt;
}
int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) {
pii ans = pii(0, 0);
for (int i = 0; i < N; i++)
ans = max(ans, pii(solve(i, N, C, R, K, S, E), -i));
return -ans.ss;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
