結果

問題 No.46 はじめのn歩
ユーザー 鹿鹿
提出日時 2021-04-07 00:01:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 559 bytes
コンパイル時間 5,007 ms
コンパイル使用メモリ 71,888 KB
実行使用メモリ 49,788 KB
最終ジャッジ日時 2023-09-02 16:55:30
合計ジャッジ時間 5,550 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,384 KB
testcase_01 AC 43 ms
49,544 KB
testcase_02 AC 41 ms
49,416 KB
testcase_03 AC 42 ms
49,328 KB
testcase_04 AC 42 ms
49,328 KB
testcase_05 AC 42 ms
49,272 KB
testcase_06 AC 42 ms
49,788 KB
testcase_07 AC 42 ms
49,752 KB
testcase_08 AC 42 ms
49,456 KB
testcase_09 AC 43 ms
49,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;

public class NWalk {
    public static void main(String[] args) throws IOException{
    	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    	
    	String numString = new String(in.readLine());
    	
    	String[] array = numString.split(" ");
    	int num1 = Integer.parseInt(array[0]);
    	int num2 = Integer.parseInt(array[1]);
    	
    	int ans = (Math.round(num2 / num1));
    	if(num2%num1 == 0){
    		System.out.println(ans);
    	} else {
    		System.out.println(ans + 1);
    	}
    	
        
    }
}
0