# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
769848 | anha3k25cvp | Segway (COI19_segway) | C++14 | 467 ms | 2024 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define dl double
#define st first
#define nd second
#define II pair <int, int>
using namespace std;
const int N = 5 + 1e5;
const int inf = 7 + 1e9;
vector <int> vis, ans, cnt;
vector <vector <int>> a;
int main() {
#define TASKNAME ""
ios_base :: sync_with_stdio (0);
cin.tie (0);
if ( fopen( TASKNAME".inp", "r" ) ) {
freopen (TASKNAME".inp", "r", stdin);
freopen (TASKNAME".out", "w", stdout);
}
int n;
cin >> n;
a.assign(n + 1, vector <int> (3, 0));
for (int i = 1; i <= n; i ++)
for (int j = 0; j < 3; j ++)
cin >> a[i][j];
int m;
cin >> m;
vis.assign(300, 0);
while (m --) {
int x;
cin >> x;
vis[x] = 1;
}
ans.assign(n + 1, 0);
cnt.assign(n + 1, 0);
for (int pos = 0; pos < 300; pos ++) {
vector <int> c;
for (int i = 1; i <= n; i ++)
c.push_back(ans[i]);
sort(c.begin(), c.end());
for (int i = 1; i <= n; i ++) {
if (vis[pos]) {
int val = lower_bound(c.begin(), c.end(), ans[i]) - c.begin();
if (!cnt[i])
cnt[i] = val % 20;
}
if (cnt[i]) {
ans[i] ++;
cnt[i] --;
}
else
ans[i] += a[i][pos / 100];
}
}
for (int i = 1; i <= n; i ++)
cout << ans[i] << '\n';
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... |