# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
758184 | BentoOreo | Fruits (NOI22_fruits) | C++14 | 98 ms | 12540 KiB |
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 <iostream>
#include <string>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <deque>
#include <set>
#include <unordered_set>
#include <algorithm>
#define ll long long
using namespace std;
int max_count = 0;
int main(){
//subtask 1 of problem 2 complete search dfs
ios::sync_with_stdio(false);
cin.tie(nullptr);
int len;
cin >> len;
vector<ll> fruits, cost;
unordered_set <ll> stuff;
int hold;
for(int i = 0; i < len; i++){
cin >> hold;
stuff.insert(hold);
fruits.push_back(hold);
}
for(int i = 0; i < len; i++){
cin >> hold;
cost.push_back(hold);
}
if(stuff.size() == 1 && *stuff.begin() == -1){
sort(cost.rbegin(),cost.rend());
ll sum = 0;
char c;
for(int i = 0; i < cost.size(); i++){
sum += cost.at(i);
cout << sum << ' ';
}
} else {
cout << "this is not my purpose :(" << endl;
}
}
Compilation message (stderr)
# | 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... |