結果

問題 No.131 マンハッタン距離
ユーザー カニ戯(ry
提出日時 2015-02-24 16:51:31
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 232 bytes
コンパイル時間 2,160 ms
コンパイル使用メモリ 74,828 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-06-23 22:46:33
合計ジャッジ時間 6,748 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] a) {
		Scanner s = new Scanner(System.in);
		int x=s.nextInt(),y=s.nextInt(),d=s.nextInt();
		System.out.println(d>x+y?0:(x>d?d:x)-(y>d?0:d-y)+1);
	}
}
0