結果
| 問題 | No.388 階段 (1) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2017-05-09 19:47:22 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 760 bytes | 
| コンパイル時間 | 3,595 ms | 
| コンパイル使用メモリ | 74,548 KB | 
| 実行使用メモリ | 41,372 KB | 
| 最終ジャッジ日時 | 2024-09-14 20:05:23 | 
| 合計ジャッジ時間 | 6,334 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 8 WA * 4 | 
ソースコード
import java.util.Scanner;
public class Question_02_0509_2 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num1 = 0;
		int num2 = 0;
		try {
			num1 = sc.nextInt();
			num2 = sc.nextInt();
			if (num1 >= 0 && num1 <= 456 && num2 >= 1 && num2 <= 123) {
				int result = 0;
				if (num1 != 0) {
					result = num1 / num2;
					if (num1 % num2 != 0 && num2 != 1) {
						result += 1;
					}
				}
				System.out.println(result);
			} else {
				System.out.println("制約違反です。 0≤現在居る段数≤456 ,1≤段数≤123");
			}
		} catch (java.util.InputMismatchException e) {
			System.out.println("数値または、整数の範囲内で入力して下さい。");
		} finally {
			sc.close();
		}
	}
}
            
            
            
        