Submission #646127

#TimeUsernameProblemLanguageResultExecution timeMemory
646127PagodePaivaSelf Study (JOI22_ho_t2)C++14
25 / 100
107 ms16252 KiB
#include<bits/stdc++.h> #define int long long #define ms(v) memset(v, -1, sizeof v) #define pi pair<int, int> #define pb push_back #define fr first #define sc second #define srt(v) sort(v.begin(), v.end()) #define INF 1e15 #define N 300010 using namespace std; int n, m; int a[N], b[N]; int32_t main(){ ios::sync_with_stdio(false); cin.tie(0); cin >> n >> m; int penis = n*m; assert(penis <= 300000); priority_queue <pi> q; for(int i = 1;i <= n;i++){ q.push({0, i}); } for(int i = 1;i <= n;i++){ cin >> a[i]; } for(int i = 1;i <= n;i++){ cin >> b[i]; } for(int i = 0;i < m;i++){ for(int j = 1;j <= n;j++){ int p = -q.top().fr; int v = q.top().sc; q.pop(); q.push({-(p + a[v]), v}); } } cout << -q.top().fr << "\n"; 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...