結果

問題 No.740 幻の木
コンテスト
ユーザー toto
提出日時 2025-04-01 10:52:27
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 387 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 40,016 KB
実行使用メモリ 9,264 KB
最終ジャッジ日時 2026-07-08 06:08:00
合計ジャッジ時間 1,091 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other AC * 3 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>

int main(){
	long long leaf, fall;
	scanf("%lld%lld",&leaf,&fall);
	
	int start,between;
	scanf("%d%d",&start,&between);
	
	int month = 1;
	int ans = 0;
	while(0 < leaf){
		if(ans % 12 < start){
			leaf -= fall;
		}else if(ans % 12 >= start && ans % fall <= start + between % 12){
			leaf -= (fall *  2);
		}
		ans++;
		month++;
		month %= 12;
	}
	printf("%d",ans);
}
0