結果

問題 No.740 幻の木
ユーザー Beat7501
提出日時 2019-01-14 10:16:16
言語 Java
(openjdk 23)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 2,474 ms
コンパイル使用メモリ 76,224 KB
実行使用メモリ 54,440 KB
最終ジャッジ日時 2025-01-02 22:50:02
合計ジャッジ時間 4,768 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

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