Submission #758184

# Submission time Handle Problem Language Result Execution time Memory
758184 2023-06-14T08:48:13 Z BentoOreo Fruits (NOI22_fruits) C++14
5 / 100
98 ms 12540 KB
#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

Main.cpp: In function 'int main()':
Main.cpp:37:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |         for(int i = 0; i < cost.size(); i++){
      |                        ~~^~~~~~~~~~~~~
Main.cpp:36:14: warning: unused variable 'c' [-Wunused-variable]
   36 |         char c;
      |              ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 1 ms 340 KB Output is correct
3 Correct 6 ms 1064 KB Output is correct
4 Correct 52 ms 6412 KB Output is correct
5 Correct 98 ms 12540 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 54 ms 12360 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -