| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363825 | hsuan._.0528 | Data Centers (EGOI22_datacenters) | C++20 | 544 ms | 2132 KiB |
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
#define pii pair<int, int>
#define F first
#define S second
const int maxn =5e5+10;
const int mod=1e9+7;
int n, s;
vector<int> a, b;
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>n>>s;
for(int i=0; i<n; i++){
int x; cin>>x;
a.push_back(x);
}
sort(a.begin(), a.end(), greater<int>() );
while(s--){
int m, c; cin>>m>>c; // 數量 幾個
int j=0;
for(int i=c; i<n; i++){
while(j<c and a[j]-m >= a[i]){
b.push_back( a[j]-m );
j++;
}
b.push_back( a[i] );
}
while(j<c){
b.push_back( a[j]-m );
j++;
}
a=b;
b.clear();
}
for(int i=0; i<n; i++) cout<<a[i]<<" ";
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... | ||||
