Submission #922749

#TimeUsernameProblemLanguageResultExecution timeMemory
922749SuPythonySelf Study (JOI22_ho_t2)C++17
35 / 100
1035 ms15296 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,m; cin>>n>>m; vector<ll> a(n), b(n); for (auto &i: a) cin>>i; for (auto &i: b) cin>>i; priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> q; for (int i=0; i<n; i++) q.push({0ll,i}); for (int j=0; j<m; j++) { vector<int> days(n,0); for (int i=0; i<n; i++) { auto t=q.top(); q.pop(); if (days[t.second]==0) { t.first+=max(a[t.second],b[t.second]); days[t.second]=1; } else { t.first+=b[t.second]; } q.push(t); } } cout<<q.top().first; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...