結果

問題 No.740 幻の木
ユーザー タキノボリ
提出日時 2019-02-18 16:03:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 364 ms
コンパイル使用メモリ 54,364 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-06 20:59:25
合計ジャッジ時間 834 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 3 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

int main()
{
    int N, M, P, Q;
    std::cin >> N >> M >> P >> Q;
    int now = 0;
    int blow = 0;
    
    while(N > 0)
    {
        now++;
        N-=M;
        if((now % 12) + 1 == P)
        {
            blow = Q; 
        }
        if(blow > 0)
        {
            blow--;
            N-=M;
        }
    }
    
    std::cout << now << std::endl;
    
    return 0;
}
0