# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
243502 | vanic | Segway (COI19_segway) | C++14 | 279 ms | 32760 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <bitset>
using namespace std;
const int maxn=2e4+5, maxp=305;
int v[maxn][3];
vector < int > q[50*maxp];
int loc[maxn];
int sad[maxp];
int acel[maxn];
bitset < maxp > boost;
int sol[maxn];
vector < int > ind;
int pref[maxp];
int main(){
int n;
scanf("%d", &n);
for(int i=0; i<n; i++){
scanf("%d%d%d", &v[i][0], &v[i][1], &v[i][2]);
q[v[i][0]].push_back(i);
}
int m;
scanf("%d", &m);
int a;
for(int i=0; i<m; i++){
scanf("%d", &a);
boost[a]=1;
}
for(int i=0; i<maxp; i++){
pref[i]=n;
}
int p;
for(int i=0; i<50*maxp; i++){
while(!q[i].empty()){
p=q[i].back();
q[i].pop_back();
ind.push_back(p);
pref[loc[p]]--;
loc[p]++;
sad[loc[p]]++;
if(loc[p]==300){
sol[p]=i;
continue;
}
if(!acel[p] && boost[loc[p]]){
acel[p]=(n-pref[loc[p]-1]-sad[loc[p]])%20;
}
if(acel[p]){
acel[p]--;
q[i+1].push_back(p);
}
else{
q[i+v[p][loc[p]/100]].push_back(p);
}
}
while(!ind.empty()){
sad[loc[ind.back()]]--;
ind.pop_back();
}
}
for(int i=0; i<n; i++){
printf("%d\n", sol[i]);
}
return 0;
}
컴파일 시 표준 에러 (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... |