結果
問題 | No.46 はじめのn歩 |
ユーザー | ぬるぬる |
提出日時 | 2016-05-14 20:05:53 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 66 ms / 5,000 ms |
コード長 | 817 bytes |
コンパイル時間 | 3,679 ms |
コンパイル使用メモリ | 74,736 KB |
実行使用メモリ | 50,796 KB |
最終ジャッジ日時 | 2024-04-15 21:34:26 |
合計ジャッジ時間 | 5,030 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 64 ms
50,184 KB |
testcase_01 | AC | 66 ms
50,612 KB |
testcase_02 | AC | 63 ms
50,716 KB |
testcase_03 | AC | 65 ms
50,236 KB |
testcase_04 | AC | 63 ms
50,652 KB |
testcase_05 | AC | 66 ms
50,680 KB |
testcase_06 | AC | 65 ms
50,416 KB |
testcase_07 | AC | 66 ms
50,776 KB |
testcase_08 | AC | 64 ms
50,796 KB |
testcase_09 | AC | 66 ms
50,428 KB |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { String str = br.readLine(); String[] result1 = str.split("[\\s]+"); if (result1.length != 2){ System.out.println("引数エラー"); System.exit(-1); } int amari = Integer.parseInt(result1[1]) % Integer.parseInt(result1[0]); if ( amari == 0 ){ System.out.println( Integer.parseInt(result1[1]) / Integer.parseInt(result1[0])); }else{ System.out.println((Integer.parseInt(result1[1]) / Integer.parseInt(result1[0]))+1); } } catch (IOException e) { e.printStackTrace(); } } }