結果

問題 No.46 はじめのn歩
ユーザー shinshin
提出日時 2022-05-15 20:15:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 805 bytes
コンパイル時間 3,784 ms
コンパイル使用メモリ 73,344 KB
実行使用メモリ 49,524 KB
最終ジャッジ日時 2023-10-11 07:31:06
合計ジャッジ時間 4,990 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,252 KB
testcase_01 AC 42 ms
49,344 KB
testcase_02 AC 43 ms
49,220 KB
testcase_03 AC 44 ms
49,376 KB
testcase_04 AC 43 ms
49,376 KB
testcase_05 AC 44 ms
49,224 KB
testcase_06 AC 44 ms
49,096 KB
testcase_07 AC 43 ms
49,096 KB
testcase_08 AC 43 ms
49,132 KB
testcase_09 AC 43 ms
49,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class No46 {

	public static void main(String[] args) throws IOException{
		//はじめのn歩
		String[] text = readStr();
		Long a = Long.valueOf(text[0].split(" ")[0]) , b = Long.valueOf(text[0].split(" ")[1]);
		Long ans = Math.floorDiv(b, a);
		if(Math.floorMod(b,a) > 0) {
			ans += 1;
		}
		System.out.println(ans);

	}
	
	public static String[] readStr() throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		ArrayList<String> list = new ArrayList<>();
		
		do {
			list.add(br.readLine());
		}while(br.ready());
		
		br.close();
		
		String[] text = new String[list.size()];
		list.toArray(text);
		
		return text;
		
	}

}
0