# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
881301 | dimashhh | Gift (IZhO18_nicegift) | C++17 | 569 ms | 192672 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 1;
#define int long long
int n,k;
ll a[N];
set<pair<ll,ll>> st;
vector<pair<vector<int>,int>> res(N * 3);
void test(){
cin >> n >> k;
for(int i = 1;i <= n;i++){
cin >> a[i];
st.insert({a[i],i});
}
int it = 1;
while(!st.empty()){
if((int)(it - 1) * k > 3e6||st.size() < k){
cout << -1 << '\n';
return;
}
vector<int> f;
int oo;
for(int i = 1;i <= k;i++){
auto [x,y] = *st.rbegin();
st.erase({x,y});
oo = x;
f.push_back(y);
}
res[it] = {f,oo};
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |