結果

問題 No.740 幻の木
ユーザー masamasa
提出日時 2019-01-31 10:35:30
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 666 bytes
コンパイル時間 439 ms
コンパイル使用メモリ 61,968 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-25 18:12:13
合計ジャッジ時間 997 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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