Submission #00095


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h>
using namespace std;
int h, w, n;
int x, y, nx = 0, ny = 0, cnt = 0;
int main()
{
cin >> h >> w >> n;
for (int i = 0; i < n; i++) {
cin >> x >> y;
if (i != 0) {
if (abs(x - nx) == abs(y - ny)) {
if (nx > x && ny > y || ny < y && nx < x || nx == ny && x == y) {
cnt += abs(x - nx);
}
else {
cnt += abs(x - nx);
cnt += abs(y - ny);
}
}
else {
cnt += abs(x - nx);
cnt += abs(y - ny);
}
}
nx = x;
ny = y;
}
cout << cnt << endl;
}

ステータス

項目 データ
問題 0005 - 超都観光 (Super Metropolis)
ユーザー名 ei1439
投稿日時 2015-11-12 18:13:32
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 569 Byte
最大実行時間 15 ms
最大メモリ使用量 564 KB

セット

セット 得点 Cases
1 in1 0 / 20 *1.txt
2 in2 0 / 20 *[12].txt
3 in3 0 / 20 *[1-3].txt
4 in4 0 / 20 *[1-4].txt
5 in5 0 / 20 *[1-5].txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2014-yo-t3-in1.txt WA 11 ms 476 KB
1
2
3
4
5
2014-yo-t3-in2.txt WA 12 ms 456 KB
2
3
4
5
2014-yo-t3-in3.txt WA 10 ms 564 KB
3
4
5
2014-yo-t3-in4.txt WA 10 ms 416 KB
4
5
2014-yo-t3-in5.txt WA 15 ms 392 KB
5