結果
問題 |
No.740 幻の木
|
ユーザー |
|
提出日時 | 2019-09-18 01:57:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 558 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 71,264 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-07 14:24:56 |
合計ジャッジ時間 | 1,129 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 WA * 3 |
ソースコード
#include <iostream> #include <algorithm> #include <vector> #include <queue> using namespace std; typedef long long int ll; int strong[12]; int main(){ int n,m,p,q; cin >> n >> m >> p >> q; int mx=(12-q)*m+2*m*q; int ans=n/mx*12; n-=n/mx*mx; for(int i=0;i<q;i++){ strong[p-1+i]=1; } for(int i=0;i<12;i++){ if(n){ if(strong[i]){ n-=2*m; } else{ n-=m; } ans++; } else break; } cout << ans << endl; }