| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368364 | hahaha | Data Centers (EGOI22_datacenters) | C++20 | 48 ms | 2280 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>());
if(n==1){
while(s--){
cin>>m>>c;
mach[0]-=m;
}
cout<<mach[0]<<endl;
return 0;
}
while(s--){
int m,c;
cin>>m>>c;
mach[0]-=m;
int i=0, j=1;
while(mach[i]<mach[j]&&j<n){
swap(mach[i],mach[j]);
i++;
j++;
}
}
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... | ||||
