結果

問題 No.740 幻の木
ユーザー Beat7501Beat7501
提出日時 2018-10-05 21:42:49
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 2,498 ms
コンパイル使用メモリ 74,228 KB
実行使用メモリ 41,388 KB
最終ジャッジ日時 2024-04-20 17:07:16
合計ジャッジ時間 3,938 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,388 KB
testcase_01 AC 130 ms
41,124 KB
testcase_02 AC 133 ms
41,084 KB
testcase_03 AC 134 ms
41,240 KB
testcase_04 AC 137 ms
41,128 KB
testcase_05 AC 132 ms
41,240 KB
testcase_06 AC 126 ms
40,164 KB
testcase_07 AC 132 ms
41,092 KB
testcase_08 AC 130 ms
41,288 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