結果

問題 No.740 幻の木
ユーザー Noiri
提出日時 2019-02-03 00:42:09
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 280 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 165,980 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-30 03:06:42
合計ジャッジ時間 1,781 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n, m, p, q;
    cin >> n >> m >> p >> q;
    int ans = 0;
    while(n > 0){
        ans++;
        if(p-1 <= ans%12 && ans%12 <= p+q-1) n -= 2*m;
        else n -= m;
    }
    cout << ans << endl;
    return 0;
}
0