結果
問題 | No.131 マンハッタン距離 |
ユーザー | crazybbb3 |
提出日時 | 2017-01-29 23:33:08 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,711 bytes |
コンパイル時間 | 2,206 ms |
コンパイル使用メモリ | 74,180 KB |
実行使用メモリ | 49,980 KB |
最終ジャッジ日時 | 2023-08-25 15:11:17 |
合計ジャッジ時間 | 4,582 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 42 ms
49,620 KB |
testcase_01 | AC | 41 ms
49,760 KB |
testcase_02 | AC | 43 ms
49,524 KB |
testcase_03 | AC | 43 ms
49,436 KB |
testcase_04 | AC | 42 ms
49,456 KB |
testcase_05 | AC | 43 ms
49,556 KB |
testcase_06 | AC | 43 ms
47,912 KB |
testcase_07 | AC | 41 ms
49,472 KB |
testcase_08 | AC | 42 ms
47,812 KB |
testcase_09 | WA | - |
testcase_10 | AC | 42 ms
49,448 KB |
testcase_11 | AC | 43 ms
49,980 KB |
testcase_12 | WA | - |
testcase_13 | AC | 42 ms
49,592 KB |
testcase_14 | AC | 43 ms
49,532 KB |
testcase_15 | AC | 43 ms
49,480 KB |
testcase_16 | AC | 42 ms
49,780 KB |
testcase_17 | AC | 42 ms
49,540 KB |
testcase_18 | AC | 43 ms
49,560 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 43 ms
49,492 KB |
testcase_22 | AC | 41 ms
49,500 KB |
testcase_23 | AC | 43 ms
49,436 KB |
testcase_24 | AC | 42 ms
49,616 KB |
testcase_25 | AC | 41 ms
49,552 KB |
testcase_26 | AC | 41 ms
49,968 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class Main { void solve() throws IOException { long x = nl(), y = nl(), d = nl(); out.println(Math.min(d + 1, Math.max(0, x + y - d + 1))); } String ns() throws IOException { while (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine(), " "); } return tok.nextToken(); } int ni() throws IOException { return Integer.parseInt(ns()); } long nl() throws IOException { return Long.parseLong(ns()); } double nd() throws IOException { return Double.parseDouble(ns()); } String[] nsa(int n) throws IOException { String[] res = new String[n]; for (int i = 0; i < n; i++) { res[i] = ns(); } return res; } int[] nia(int n) throws IOException { int[] res = new int[n]; for (int i = 0; i < n; i++) { res[i] = ni(); } return res; } long[] nla(int n) throws IOException { long[] res = new long[n]; for (int i = 0; i < n; i++) { res[i] = nl(); } return res; } static BufferedReader in; static PrintWriter out; static StringTokenizer tok; public static void main(String[] args) throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); tok = new StringTokenizer(""); Main main = new Main(); main.solve(); out.close(); } }