結果

問題 No.740 幻の木
コンテスト
ユーザー masa
提出日時 2019-01-31 10:35:30
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 666 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 372 ms
コンパイル使用メモリ 82,624 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-08 11:58:37
合計ジャッジ時間 1,264 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <map>
using namespace std;
template<class T> bool maxPointer(T& a, T b) { if (a < b) {a = b;return true;}return false;}
template<class T> int maxReturn(T a, T b) {if (a > b) {return a;} else {return b;}}
template<class T> bool minPointer(T& a, T b) {if (a < b) {a = b;return true;}return false;}


int main(void){
    int N,M,P,Q,month = 1,res=0,windBounus=1;
    cin >> N >> M >> P >> Q;
    
    for(; N > 0; res++) {
        if (month == P+Q) windBounus = 1;
        if (month == 13) month = 1;
    	if (month == P) windBounus = 2;
    	

    	N -= M * windBounus;
    	month++;
    }
    
    cout << res << endl;
}
0