| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363751 | yyc000123 | Data Centers (EGOI22_datacenters) | C++20 | 1513 ms | 1960 KiB |
#include<bits/stdc++.h>
using namespace std ;
const int N = 1e5+5 ;
const int S = 5005 ;
int n , s ;
vector<int> v ;
int main(){
ios::sync_with_stdio(0),cin.tie(0),cout.tie(0) ;
cin >> n >> s ;
for(int i=0 ; i<n ; i++){
int x ; cin >> x ; v.push_back(x) ;
}
sort(v.begin(),v.end(),greater<int>()) ;
while(s--){
int a , b ; cin >> a >> b ;
int le = 0 , ri = b ;
vector<int> temp ;
while(le<b && ri<n){
if(v[le]-a>=v[ri]) temp.push_back(v[le]-a) , le++ ;
else temp.push_back(v[ri]) , ri++ ;
}
while(le<b) temp.push_back(v[le]-a) , le++ ;
while(ri<n) temp.push_back(v[ri]) , ri++ ;
for(int i=0 ; i<n ; i++) v[i]=temp[i] ;
}
for(int i:v) cout << i << ' ' ;
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... | ||||
