| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367309 | biserailieva | Data Centers (EGOI22_datacenters) | C++20 | 2095 ms | 6960 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, s;
cin >> n >> s;
multiset<long long> ms;
for (int i = 0; i < n; i++) {
long long x;
cin >> x;
ms.insert(x);
}
while (s--) {
long long m, c;
cin >> m >> c;
vector<long long> taken;
auto it = ms.end();
for (int i = 0; i < c; i++) {
--it;
taken.push_back(*it);
}
for (auto x : taken) {
ms.erase(ms.find(x));
}
for (auto &x : taken) {
ms.insert(x - m);
}
}
vector<long long> ans(ms.begin(), ms.end());
sort(ans.rbegin(), ans.rend());
for (auto x : ans) {
cout << x << " ";
}
cout << "\n";
return 0;
}| # | 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... | ||||
