This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
int x,n; cin>>n;
ll ans =0;
vector<int>rows, price;
for (int i =0;i<n;i++){
cin>>x; rows.push_back(x);
}
for (int i =0;i<n;i++){
cin>>x; price.push_back(x);
}
sort(price.begin(),price.end());
for (int i =n-1; i>=0;i--){
ans += price[i]; cout<<ans<<" ";
}
}
# | 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... |