結果

問題 No.740 幻の木
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-05 21:42:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 473 bytes
コンパイル時間 2,314 ms
コンパイル使用メモリ 73,868 KB
実行使用メモリ 41,564 KB
最終ジャッジ日時 2024-04-20 17:07:08
合計ジャッジ時間 4,213 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,360 KB
testcase_01 AC 134 ms
41,448 KB
testcase_02 AC 133 ms
41,088 KB
testcase_03 AC 136 ms
41,416 KB
testcase_04 AC 134 ms
41,488 KB
testcase_05 AC 134 ms
41,296 KB
testcase_06 AC 138 ms
41,008 KB
testcase_07 AC 134 ms
41,524 KB
testcase_08 AC 139 ms
41,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n=scanner.nextInt();
		int m=scanner.nextInt();
		int p=scanner.nextInt();
		int q=scanner.nextInt();
		
		int mon=0;
		int ans=0;
		while(n>0) {
			mon++;
			if(mon==13) {
				mon=1;
			}
			if(p<=mon&&mon<p+q) {
				n-=2*m;
			}
			else {
				n-=m;
			}
			ans++;
		}
		System.out.println(ans);
	}
}
0