結果
| 問題 | No.740 幻の木 |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2020-04-03 12:39:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 287 bytes |
| コンパイル時間 | 1,459 ms |
| コンパイル使用メモリ | 165,796 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 17:45:43 |
| 合計ジャッジ時間 | 2,065 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N, M, P, Q;
cin >> N >> M >> P >> Q;
int ans = 1;
while( true ) {
int mm = (ans - 1) % 12 + 1;
if( P <= mm && mm <= P + Q - 1 ) N -= M * 2;
else N -= M;
if( N <= 0 ) break;
ans++;
}
cout << ans << endl;
}
forest3