結果

問題 No.740 幻の木
ユーザー Beat7501
提出日時 2018-10-05 21:42:49
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 2,977 ms
コンパイル使用メモリ 74,168 KB
実行使用メモリ 54,168 KB
最終ジャッジ日時 2024-10-12 12:59:20
合計ジャッジ時間 3,702 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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