結果
| 問題 | No.740 幻の木 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-04-10 20:00:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 234 bytes |
| 記録 | |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 22,784 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-15 11:52:55 |
| 合計ジャッジ時間 | 965 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%d %d %d %d",&N,&M,&P,&Q);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <cstdio>
int main(){
int N,M,P,Q,month;
scanf("%d %d %d %d",&N,&M,&P,&Q);
for(month=0;N>0;month++){
N-=M;
if(P<=month%12+1 && month%12+1<=P+Q-1)N-=M;
}
printf("%d\n",month);
return 0;
}