結果
問題 | No.46 はじめのn歩 |
ユーザー | rabi |
提出日時 | 2019-06-24 11:37:23 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 121 ms / 5,000 ms |
コード長 | 804 bytes |
コンパイル時間 | 3,639 ms |
コンパイル使用メモリ | 75,468 KB |
実行使用メモリ | 58,192 KB |
最終ジャッジ日時 | 2023-08-30 23:12:40 |
合計ジャッジ時間 | 5,596 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 119 ms
55,912 KB |
testcase_01 | AC | 119 ms
55,756 KB |
testcase_02 | AC | 119 ms
55,868 KB |
testcase_03 | AC | 119 ms
55,828 KB |
testcase_04 | AC | 121 ms
58,192 KB |
testcase_05 | AC | 120 ms
55,724 KB |
testcase_06 | AC | 120 ms
56,124 KB |
testcase_07 | AC | 119 ms
55,868 KB |
testcase_08 | AC | 118 ms
55,716 KB |
testcase_09 | AC | 117 ms
55,688 KB |
ソースコード
import java.util.Scanner; public class Tester2 { private static final int MAX = 1000000000; public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String[] ary = str.split(" "); int[] arr = strChg(ary); System.out.println(turnN(arr)); } static int[] strChg(String[] ary) { int i = ary.length; int[] arr = new int[i]; for(int j=0;j<ary.length;j++) { arr[j] = Integer.parseInt(ary[j]); } return arr; } static int turnN(int[] ary) { int num=0; if(1<=ary[0] && ary[0]<=MAX) if(1<=ary[1] && ary[1]<=MAX) num = chk(ary); return num; } static int chk(int[] ary) { int num; int a = ary[1]%ary[0]; if(a != 0) { num = ary[1]/ary[0]; num++; }else { num = ary[1]/ary[0]; } return num; } }