結果

問題 No.46 はじめのn歩
ユーザー 水野嶺
提出日時 2020-05-14 14:02:41
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 562 bytes
コンパイル時間 3,896 ms
コンパイル使用メモリ 82,692 KB
実行使用メモリ 54,172 KB
最終ジャッジ日時 2024-09-15 05:42:18
合計ジャッジ時間 7,339 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		//商
		int n = b / a;
		//余あまり
		int m = b % a;
		
		//あまりの有無で条件分岐
		//余りがない場合
		if(m == 0){
		System.out.println(n);
		
		//余りあり
		}else{
		System.out.println(n + 1);
		}
		
	}
}
0