Submission #00084


ソースコード

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
#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 (nx == 0 && ny == 0) {
nx = x;
ny = y;
}
else if (abs(x - nx) == abs(y - ny)) {
cnt += abs(x - nx);
}
else {
cnt += abs(x - nx);
cnt += abs(y - ny);
}
nx = x;
ny = y;
}
cout << cnt << endl;
}

ステータス

項目 データ
問題 0005 - 超都観光 (Super Metropolis)
ユーザー名 ei1439
投稿日時 2015-11-12 18:03:48
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 488 Byte
最大実行時間 14 ms
最大メモリ使用量 532 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 14 ms 476 KB
1
2
3
4
5
2014-yo-t3-in2.txt WA 11 ms 452 KB
2
3
4
5
2014-yo-t3-in3.txt WA 12 ms 428 KB
3
4
5
2014-yo-t3-in4.txt WA 10 ms 532 KB
4
5
2014-yo-t3-in5.txt WA 12 ms 508 KB
5