| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368366 | hahaha | Data Centers (EGOI22_datacenters) | C++20 | 2094 ms | 3020 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back
const int N=1e5+7;
int n,s,m,c;
vector<int>mach;
signed main(){
cin>>n>>s;
int mx=0;
for(int i=0; i<n; i++){
int x;
cin>>x;
mach.pb(x);
}
sort(mach.begin(), mach.end(), greater<int>());
while(s--){
int m,c;
cin>>m>>c;
vector<int> chng;
vector<int> temp;
for(int i=c; i<n; i++)
temp.pb(mach[i]);
for(int i=0; i<c; i++)
chng.pb(mach[i]-m);
int x=0, y=0;
int i=0;
while(x<chng.size()&&y<temp.size()){
if(chng[x]>temp[y]) {mach[i]=chng[x]; x++;}
else {mach[i]=temp[y]; y++;}
i++;
}
while(x<chng.size()) {mach[i]=chng[x]; x++; i++;}
while(y<temp.size()){mach[i]=temp[y]; y++; i++;}
}
for(auto i: mach)
cout<<i<<" ";
cout<<endl;
} | # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
