結果

問題 No.46 はじめのn歩
ユーザー rabirabi
提出日時 2019-06-24 11:35:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 818 bytes
コンパイル時間 3,645 ms
コンパイル使用メモリ 74,976 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-08-30 23:05:47
合計ジャッジ時間 5,089 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,800 KB
testcase_01 AC 117 ms
55,564 KB
testcase_02 AC 117 ms
55,536 KB
testcase_03 AC 119 ms
56,012 KB
testcase_04 AC 123 ms
56,208 KB
testcase_05 AC 119 ms
56,188 KB
testcase_06 AC 118 ms
55,828 KB
testcase_07 AC 117 ms
55,932 KB
testcase_08 AC 119 ms
55,988 KB
testcase_09 AC 117 ms
55,680 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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();
		sc.close();
		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;
	}

}
0