結果
問題 |
No.9 モンスターのレベル上げ
|
ユーザー |
|
提出日時 | 2025-08-07 00:26:42 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 559 ms / 5,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 3,688 ms |
コンパイル使用メモリ | 284,660 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-07 00:26:52 |
合計ジャッジ時間 | 8,463 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) int main(){ int N;cin>>N; vector<int> A(N),B(N); rep(i,N) cin>>A[i]; rep(i,N) cin>>B[i]; vector<pair<int,int>> temp(N); rep(i,N) temp[i]={A[i],0}; multiset<pair<int,int>> temps(temp.begin(),temp.end()); int ans=1e9; rep(i,N){ auto s=temps; int ma=0; rep(j,N){ auto [t,u]=*s.begin(); s.erase(s.begin()); s.insert({t+B[(i+j)%N]/2,u+1}); ma=max(ma,u+1); } ans=min(ans,ma); } cout<<ans<<"\n"; return 0; }