#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 |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
340 KB |
Output is correct |
3 |
Correct |
13 ms |
736 KB |
Output is correct |
4 |
Correct |
124 ms |
4704 KB |
Output is correct |
5 |
Correct |
234 ms |
9020 KB |
Output is correct |
6 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
185 ms |
6168 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |