結果

問題 No.740 幻の木
ユーザー Beat7501Beat7501
提出日時 2019-01-14 10:16:16
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 1,949 ms
コンパイル使用メモリ 71,212 KB
実行使用メモリ 56,388 KB
最終ジャッジ日時 2023-08-30 23:23:39
合計ジャッジ時間 3,923 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
56,192 KB
testcase_01 AC 122 ms
56,060 KB
testcase_02 AC 121 ms
55,648 KB
testcase_03 AC 121 ms
56,388 KB
testcase_04 AC 122 ms
56,012 KB
testcase_05 AC 122 ms
55,836 KB
testcase_06 AC 126 ms
55,540 KB
testcase_07 AC 120 ms
56,104 KB
testcase_08 AC 120 ms
56,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int p = sc.nextInt();
		int q = sc.nextInt();
		int a = 0;
		int mo = 1;
		while(n > 0){
			a++;
			if(mo >= p && mo <= p + q - 1){
				n -= 2*m;
			}else{
				n -=m;
			}
			mo++;
			if(mo == 13){
				mo = 1;
			}
		}
		System.out.print(a);
	}
}
0