結果
問題 |
No.740 幻の木
|
ユーザー |
![]() |
提出日時 | 2018-10-09 02:24:29 |
言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 482 bytes |
コンパイル時間 | 6,162 ms |
コンパイル使用メモリ | 252,280 KB |
最終ジャッジ日時 | 2025-01-06 14:26:46 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int cnt = 0; int m, p, q; cin >> m >> p >> q; int hard[12] = {}; int crt = 1; for (int i = p; i < p + q; i++) { hard[i] = 1; } while (n > 0) { if (hard[crt]) { n -= 2 * m; } else { n -= m; } crt++; cnt++; if (crt == 13) { crt = 1; } } cout << cnt << endl; }