結果
| 問題 | No.740 幻の木 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-01-31 10:35:30 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 3 ms / 2,000 ms | 
| コード長 | 666 bytes | 
| コンパイル時間 | 634 ms | 
| コンパイル使用メモリ | 61,824 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-08 05:38:12 | 
| 合計ジャッジ時間 | 1,307 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 | 
ソースコード
#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;
}
            
            
            
        