結果
問題 | No.740 幻の木 |
ユーザー |
![]() |
提出日時 | 2019-08-28 17:40:23 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 598 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 30,592 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-17 16:27:44 |
合計ジャッジ時間 | 628 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <stdbool.h>#include <math.h>int main(void){int leaf,lost,wind,swind,monthcnt=0;scanf("%d %d %d %d",&leaf,&lost,&swind,&wind);while(1){for(int i=1;i<=12;i++){monthcnt++;if(swind<=i&&i<swind+wind){leaf-=lost*2;}else{leaf-=lost;}if(leaf<=0){goto escape;}}}escape:printf("%d",monthcnt);}