# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
64683 | 2018-08-05T11:39:19 Z | Vahan | 마상시합 토너먼트 (IOI12_tournament) | C++17 | 1000 ms | 120908 KB |
#include<vector> using namespace std; vector<int> g[5000000]; int a[5000000],o=-1,f; void hetqc(int x,int y,int nn) { for(int i=y;i<nn;i++) a[i]=a[i-y+x]; } int GetBestPosition(int N, int C, int R, int *K, int *S, int *E) { int n=N; int t=n; for(int i=0;i<n;i++) a[i]=i; int nn=n; for(int i=0;i<C;i++) { for(int j=S[i];j<=E[i];j++) g[t].push_back(a[j]); a[S[i]]=t; t++; nn-=E[i]-S[i]; hetqc(E[i]+1,S[i]+1,nn); } for(int i=0;i<n;i++) { int e=0; for(int j=0;j<n;j++) { if(i==j) { a[j]=R; e=1; } else if(e==0) a[j]=K[j]; else a[j]=K[j-1]; } int q=0; for(int j=n;j<t;j++) a[j]=-1; for(int j=n;j<t;j++) { for(int e=0;e<g[j].size();e++) a[j]=max(a[j],a[g[j][e]]); if(a[j]==R) q++; } if(q>o) { o=q; f=i; } } return f; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 123 ms | 117752 KB | Output is correct |
2 | Correct | 116 ms | 117848 KB | Output is correct |
3 | Correct | 116 ms | 117912 KB | Output is correct |
4 | Correct | 104 ms | 117984 KB | Output is correct |
5 | Correct | 117 ms | 117984 KB | Output is correct |
6 | Correct | 107 ms | 118044 KB | Output is correct |
7 | Correct | 128 ms | 118044 KB | Output is correct |
8 | Correct | 106 ms | 118204 KB | Output is correct |
9 | Correct | 105 ms | 118204 KB | Output is correct |
10 | Correct | 106 ms | 118204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 120 ms | 118204 KB | Output is correct |
2 | Correct | 329 ms | 118336 KB | Output is correct |
3 | Correct | 174 ms | 118336 KB | Output is correct |
4 | Correct | 313 ms | 118472 KB | Output is correct |
5 | Correct | 276 ms | 118628 KB | Output is correct |
6 | Correct | 293 ms | 118628 KB | Output is correct |
7 | Correct | 300 ms | 118628 KB | Output is correct |
8 | Correct | 292 ms | 118680 KB | Output is correct |
9 | Correct | 181 ms | 118680 KB | Output is correct |
10 | Correct | 335 ms | 118768 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1089 ms | 120908 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |