結果

問題 No.46 はじめのn歩
ユーザー rabi
提出日時 2019-06-24 11:37:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 804 bytes
コンパイル時間 5,771 ms
コンパイル使用メモリ 80,620 KB
実行使用メモリ 54,396 KB
最終ジャッジ日時 2025-01-02 22:23:28
合計ジャッジ時間 7,309 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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();
		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