結果
| 問題 | No.131 マンハッタン距離 |
| コンテスト | |
| ユーザー |
kanra661
|
| 提出日時 | 2015-01-21 00:48:20 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 5,000 ms |
| コード長 | 492 bytes |
| 記録 | |
| コンパイル時間 | 2,568 ms |
| コンパイル使用メモリ | 82,524 KB |
| 実行使用メモリ | 46,908 KB |
| 最終ジャッジ日時 | 2026-03-07 07:16:22 |
| 合計ジャッジ時間 | 4,635 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
import java.util.Scanner;
public class No_103 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int d = sc.nextInt();
int count = 0;
if (x + y < d) {
System.out.println(count);
return;
}
if (x + y == d) {
System.out.println(1);
return;
}
int tx = 0;
int ty = 0;
count = d + 1;
if (x < d)
count -= (d - x);
if (y < d)
count -= (d - y);
System.out.println(count);
}
}
kanra661