結果
問題 | No.446 ゆきこーだーの雨と雪 (1) |
ユーザー | kenji_shioya |
提出日時 | 2017-01-07 14:56:39 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 118 ms / 2,000 ms |
コード長 | 655 bytes |
コンパイル時間 | 3,599 ms |
コンパイル使用メモリ | 72,564 KB |
実行使用メモリ | 56,052 KB |
最終ジャッジ日時 | 2023-08-22 16:14:52 |
合計ジャッジ時間 | 6,020 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
55,568 KB |
testcase_01 | AC | 113 ms
55,672 KB |
testcase_02 | AC | 113 ms
55,808 KB |
testcase_03 | AC | 116 ms
56,000 KB |
testcase_04 | AC | 115 ms
55,960 KB |
testcase_05 | AC | 114 ms
55,796 KB |
testcase_06 | AC | 111 ms
55,812 KB |
testcase_07 | AC | 113 ms
55,488 KB |
testcase_08 | AC | 113 ms
55,476 KB |
testcase_09 | AC | 113 ms
55,752 KB |
testcase_10 | AC | 114 ms
55,812 KB |
testcase_11 | AC | 113 ms
55,856 KB |
testcase_12 | AC | 114 ms
55,552 KB |
testcase_13 | AC | 114 ms
56,052 KB |
testcase_14 | AC | 118 ms
55,896 KB |
testcase_15 | AC | 113 ms
55,508 KB |
testcase_16 | AC | 114 ms
55,836 KB |
ソースコード
import java.util.*; import java.lang.NumberFormatException; public class Rain { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] array = new String[2]; array[0] = sc.next(); array[1] = sc.next(); try { for (String x : array) { if (x.startsWith("0") && x.length() > 1) { throw new NumberFormatException(); } int y = Integer.parseInt(x); if (y > 12345){ throw new NumberFormatException(); } } } catch(NumberFormatException e) { System.out.println("NG"); return; } System.out.println("OK"); } }