# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
222576 | kingfran1907 | Segway (COI19_segway) | C++14 | 293 ms | 1404 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e4+10;
int n, m;
int v[maxn][3];
int dis[maxn];
int ac[maxn];
bool flag[maxn];
vector< pair<int, int> > tren, cp;
int main() {
memset(flag, false, sizeof flag);
scanf("%d", &n);
for (int i = 0; i < n; i++)
for (int j = 0; j < 3; j++)
scanf("%d", &v[i][j]);
scanf("%d", &m);
for (int i = 0; i < m; i++) {
int x;
scanf("%d", &x);
flag[x] = true;
}
for (int i = 0; i < n; i++)
tren.push_back(make_pair(0, i));
for (int t = 0; t < 300; t++) {
cp.clear();
int cnt = 0;
int preftim = -1;
for (int i = 0; i < n; i++) {
int tim = tren[i].first;
int ind = tren[i].second;
if (tim != preftim) cnt = i;
preftim = tim;
if (flag[t] && ac[ind] == 0) ac[ind] = cnt % 20;
if (ac[ind] > 0) {
ac[ind]--;
dis[ind]++;
} else
dis[ind] += v[ind][t / 100];
cp.push_back(make_pair(dis[ind], ind));
}
tren = cp;
sort(tren.begin(), tren.end());
}
for (int i = 0; i < n; i++)
printf("%d\n", dis[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... |