結果
問題 | No.740 幻の木 |
ユーザー |
|
提出日時 | 2019-09-18 01:58:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 560 bytes |
コンパイル時間 | 616 ms |
コンパイル使用メモリ | 71,264 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 14:24:58 |
合計ジャッジ時間 | 1,052 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 |
ソースコード
#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>0){ if(strong[i]){ n-=2*m; } else{ n-=m; } ans++; } else break; } cout << ans << endl; }