# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
65504 | gs13068 | 장난감 기차 (IOI17_train) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
using namespace std;
int d[2][5005], s[5005];
vector<int> g[5005];
vector<int> who_wins(vector<int> a, vector<int> r, vector<int> u, vector<int> v) {
int i, j, n = a.size(), m = u.size();
int *p = d[0], *q = d[1], *t;
for (i = 0; i < m; i++) g[u[i]].push_back(v[i]);
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (a[j] == 1) {
q[j] = 0;
for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t];
}
else {
q[j] = 1e9;
for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t];
}
if (r[j]) q[j]++;
}
t = p; p = q; q = t;
}
for (i = 0; i < n; i++) s[i] = p[i];
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (a[j] == 1) {
q[j] = 0;
for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t];
}
else {
q[j] = 1e9;
for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t];
}
if (r[j]) q[j]++;
}
t = p; p = q; q = t;
}
vector<int> ans;
for (i = 0; i < n; i++) ans.push_back(p[i] > s[i] ? 1 : 2)
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
train.cpp:10:2: error: stray '\302' in program for (j = 0; j < n; j++) { ^ train.cpp:10:3: error: stray '\240' in program for (j = 0; j < n; j++) { ^ train.cpp:11:2: error: stray '\302' in program if (a[j] == 1) { ^ train.cpp:11:3: error: stray '\240' in program if (a[j] == 1) { ^ train.cpp:11:5: error: stray '\302' in program if (a[j] == 1) { ^ train.cpp:11:6: error: stray '\240' in program if (a[j] == 1) { ^ train.cpp:12:2: error: stray '\302' in program q[j] = 0; ^ train.cpp:12:3: error: stray '\240' in program q[j] = 0; ^ train.cpp:12:5: error: stray '\302' in program q[j] = 0; ^ train.cpp:12:6: error: stray '\240' in program q[j] = 0; ^ train.cpp:12:8: error: stray '\302' in program q[j] = 0; ^ train.cpp:12:9: error: stray '\240' in program q[j] = 0; ^ train.cpp:13:2: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:13:3: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:13:5: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:13:6: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:13:8: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:13:9: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:14:2: error: stray '\302' in program } ^ train.cpp:14:3: error: stray '\240' in program } ^ train.cpp:14:5: error: stray '\302' in program } ^ train.cpp:14:6: error: stray '\240' in program } ^ train.cpp:15:2: error: stray '\302' in program else { ^ train.cpp:15:3: error: stray '\240' in program else { ^ train.cpp:15:5: error: stray '\302' in program else { ^ train.cpp:15:6: error: stray '\240' in program else { ^ train.cpp:16:2: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:16:3: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:16:5: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:16:6: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:16:8: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:16:9: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:17:2: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:17:3: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:17:5: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:17:6: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:17:8: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:17:9: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:18:2: error: stray '\302' in program } ^ train.cpp:18:3: error: stray '\240' in program } ^ train.cpp:18:5: error: stray '\302' in program } ^ train.cpp:18:6: error: stray '\240' in program } ^ train.cpp:19:2: error: stray '\302' in program if (r[j]) q[j]++; ^ train.cpp:19:3: error: stray '\240' in program if (r[j]) q[j]++; ^ train.cpp:19:5: error: stray '\302' in program if (r[j]) q[j]++; ^ train.cpp:19:6: error: stray '\240' in program if (r[j]) q[j]++; ^ train.cpp:20:2: error: stray '\302' in program } ^ train.cpp:20:3: error: stray '\240' in program } ^ train.cpp:21:2: error: stray '\302' in program t = p; p = q; q = t; ^ train.cpp:21:3: error: stray '\240' in program t = p; p = q; q = t; ^ train.cpp:25:2: error: stray '\302' in program for (j = 0; j < n; j++) { ^ train.cpp:25:3: error: stray '\240' in program for (j = 0; j < n; j++) { ^ train.cpp:26:2: error: stray '\302' in program if (a[j] == 1) { ^ train.cpp:26:3: error: stray '\240' in program if (a[j] == 1) { ^ train.cpp:26:5: error: stray '\302' in program if (a[j] == 1) { ^ train.cpp:26:6: error: stray '\240' in program if (a[j] == 1) { ^ train.cpp:27:2: error: stray '\302' in program q[j] = 0; ^ train.cpp:27:3: error: stray '\240' in program q[j] = 0; ^ train.cpp:27:5: error: stray '\302' in program q[j] = 0; ^ train.cpp:27:6: error: stray '\240' in program q[j] = 0; ^ train.cpp:27:8: error: stray '\302' in program q[j] = 0; ^ train.cpp:27:9: error: stray '\240' in program q[j] = 0; ^ train.cpp:28:2: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:28:3: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:28:5: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:28:6: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:28:8: error: stray '\302' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:28:9: error: stray '\240' in program for (auto t : g[j]) if (p[t] > q[j]) q[j] = p[t]; ^ train.cpp:29:2: error: stray '\302' in program } ^ train.cpp:29:3: error: stray '\240' in program } ^ train.cpp:29:5: error: stray '\302' in program } ^ train.cpp:29:6: error: stray '\240' in program } ^ train.cpp:30:2: error: stray '\302' in program else { ^ train.cpp:30:3: error: stray '\240' in program else { ^ train.cpp:30:5: error: stray '\302' in program else { ^ train.cpp:30:6: error: stray '\240' in program else { ^ train.cpp:31:2: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:31:3: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:31:5: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:31:6: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:31:8: error: stray '\302' in program q[j] = 1e9; ^ train.cpp:31:9: error: stray '\240' in program q[j] = 1e9; ^ train.cpp:32:2: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:32:3: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:32:5: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:32:6: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:32:8: error: stray '\302' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:32:9: error: stray '\240' in program for (auto t : g[j]) if (p[t] < q[j]) q[j] = p[t]; ^ train.cpp:33:2: error: stray '\302' in program } ^ train.cpp:33:3: error: stray '\240' in program } ^ train.cpp:33:5: error: stray '\302' in program } ^ train.cpp:33:6: error: stray '\240' in program } ^ train.cpp:34:2: error: stray '\302' in program if (r[j]) q[j]++; ^ train.cpp:34:3: error: stray '\240' in program if (r[j]) q[j]++; ^ train.cpp:34:5: error: stray '\302' in program if (r[j]) q[j]++; ^ train.cpp:34:6: error: stray '\240' in program if (r[j]) q[j]++; ^ train.cpp:35:2: error: stray '\302' in program } ^ train.cpp:35:3: error: stray '\240' in program } ^ train.cpp:36:2: error: stray '\302' in program t = p; p = q; q = t; ^ train.cpp:36:3: error: stray '\240' in program t = p; p = q; q = t; ^ train.cpp:38:2: error: stray '\302' in program vector<int> ans; ^ train.cpp:38:3: error: stray '\240' in program vector<int> ans; ^ train.cpp:39:2: error: stray '\302' in program for (i = 0; i < n; i++) ans.push_back(p[i] > s[i] ? 1 : 2) ^ train.cpp:39:3: error: stray '\240' in program for (i = 0; i < n; i++) ans.push_back(p[i] > s[i] ? 1 : 2) ^ train.cpp:40:2: error: stray '\302' in program return ans; ^ train.cpp:40:3: error: stray '\240' in program return ans; ^ train.cpp:40:5: error: stray '\302' in program return ans; ^ train.cpp:40:6: error: stray '\240' in program return ans; ^ train.cpp: In function 'std::vector<int> who_wins(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)': train.cpp:40:7: error: expected ';' before 'return' return ans; ^~~~~~ train.cpp:41:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^