結果
| 問題 | No.740 幻の木 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-01 01:00:54 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 331µs | |
| コード長 | 308 bytes |
| 記録 | |
| コンパイル時間 | 2,781 ms |
| コンパイル使用メモリ | 153,904 KB |
| 実行使用メモリ | 9,796 KB |
| 最終ジャッジ日時 | 2026-09-01 01:01:44 |
| 合計ジャッジ時間 | 4,174 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 |
ソースコード
#include<iostream>
using namespace std;
int main(void){
int n, m, p, q; cin >> n >> m >> p >> q; n--;
int x=q*2*m+(12-q)*m, r=n%x;
int ans=n/x*12;
for(int i=1; i<=12; i++){
int fall=(i<p||p+q<=i?m:2*m);
if(r<fall){
cout << ans+i << endl; return 0;
}
r-=fall;
}
return 0;
}