| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1346758 | mxhrvs | Data Centers (EGOI22_datacenters) | C++20 | 278 ms | 2828 KiB |
#include<bits/stdc++.h>
using namespace std;
signed main(){
long long n,s;
cin >> n >> s;
vector<long long> a(n),m(s),c(s);
for(auto &i : a) cin >> i;
sort(a.rbegin(),a.rend());
for(long long i = 0; i < s; i ++){
cin >> m[i] >> c[i];
for(long long j = 0; j < c[i]; j ++){
a[j] -= m[i];
}
vector<long long> temp(n);
long long p1 = 0;
long long p2 = c[i];
long long pt = 0;
while(p1 < c[i] and p2 < n){
if(a[p1] >= a[p2]){
temp[pt ++] = a[p1 ++];
}
else{
temp[pt ++] = a[p2 ++];
}
}
while(p1 < c[i]){
temp[pt ++] = a[p1 ++];
}
while(p2 < n){
temp[pt ++] = a[p2 ++];
}
a.swap(temp);
}
for(auto &i : a) cout << i << " ";
}| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
