Submission #1051702

#TimeUsernameProblemLanguageResultExecution timeMemory
1051702PiokemonA Plus B (IOI23_aplusb)C++17
100 / 100
33 ms4032 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; constexpr int N = 1e5; int p[N+9]; std::vector<int> smallest_sums(int n, std::vector<int> a, std::vector<int> b) { priority_queue<pair<int,int>> ter; for (int x=0;x<n;x++){ p[x]=0; ter.push({-(a[x]+b[0]),x}); } b.push_back(2e9); vector<int> odp; for (int x=0;x<n;x++){ pair<int,int> t=ter.top(); ter.pop(); odp.push_back(-t.first); p[t.second]++; ter.push({-(a[t.second]+b[p[t.second]]),t.second}); } return odp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...