結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2015-05-15 12:55:42 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 106 ms / 5,000 ms |
コード長 | 377 bytes |
コンパイル時間 | 2,118 ms |
コンパイル使用メモリ | 74,204 KB |
実行使用メモリ | 41,500 KB |
最終ジャッジ日時 | 2024-07-06 03:55:22 |
合計ジャッジ時間 | 5,407 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final long x = sc.nextLong(); final long y = sc.nextLong(); final long d = sc.nextLong(); System.out.println(Math.max(0, (d + 1) - Math.max(0, d - x) - Math.max(0, d - y))); } }