結果
| 問題 | No.131 マンハッタン距離 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-01-31 12:26:54 |
| 言語 | D (dmd 2.109.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 320 bytes |
| 記録 | |
| コンパイル時間 | 743 ms |
| コンパイル使用メモリ | 99,524 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-12 06:46:06 |
| 合計ジャッジ時間 | 1,767 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 15 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string;
void main()
{
auto rd = readln.split.to!(int[]), x = rd[0], y = rd[1], d = rd[2];
auto r = d + 1;
if (d == 0) {
r = 1;
} else if (x + y < d) {
r = 0;
} else {
if (x > d) r -= x - d;
if (y > d) r -= y - d;
}
writeln(r);
}