結果
問題 | No.467 隠されていたゲーム |
ユーザー | Vir_MeL0 |
提出日時 | 2017-03-22 03:10:41 |
言語 | Java19 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,110 bytes |
コンパイル時間 | 3,277 ms |
コンパイル使用メモリ | 74,256 KB |
実行使用メモリ | 51,300 KB |
最終ジャッジ日時 | 2023-09-19 05:30:09 |
合計ジャッジ時間 | 5,067 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
49,304 KB |
testcase_01 | AC | 44 ms
49,700 KB |
testcase_02 | AC | 44 ms
47,824 KB |
testcase_03 | AC | 44 ms
49,304 KB |
testcase_04 | AC | 45 ms
49,384 KB |
testcase_05 | AC | 44 ms
49,352 KB |
testcase_06 | AC | 44 ms
49,396 KB |
testcase_07 | AC | 45 ms
49,164 KB |
testcase_08 | AC | 44 ms
49,224 KB |
testcase_09 | AC | 44 ms
49,936 KB |
testcase_10 | AC | 44 ms
49,664 KB |
testcase_11 | AC | 44 ms
49,304 KB |
testcase_12 | AC | 44 ms
49,312 KB |
testcase_13 | AC | 44 ms
49,484 KB |
testcase_14 | AC | 44 ms
49,296 KB |
testcase_15 | AC | 45 ms
49,308 KB |
testcase_16 | AC | 44 ms
49,276 KB |
testcase_17 | AC | 44 ms
49,184 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 44 ms
49,516 KB |
testcase_24 | AC | 44 ms
49,364 KB |
testcase_25 | AC | 44 ms
49,340 KB |
testcase_26 | AC | 45 ms
49,176 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main{ public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str = br.readLine(); int n = Integer.parseInt(str); str = br.readLine(); String[] dstr = str.split(" "); int[] d = new int[n]; for (int i = 0; i < n; i++) d[i] = Integer.parseInt(dstr[i]); str = br.readLine(); String[] coordinate = str.split(" "); int x = Integer.parseInt(coordinate[0]); int y = Integer.parseInt(coordinate[1]); int dst = Math.max(Math.abs(x), Math.abs(y)); if (dst == 0) System.out.println("0"); else if (dst < d[0]) System.out.println("2"); else if (dst <= d[n - 1]) { boolean flag = false; for (int dist : d) { if (dst == dist) { System.out.println("1"); flag = true; break; } } if (!flag) System.out.println("2"); } else { if (dst % d[n - 1] == 0) System.out.println(dst / d[n - 1]); else System.out.println(dst / d[n - 1] + 1); } } }