Submission #282098

# Submission time Handle Problem Language Result Execution time Memory
282098 2020-08-24T02:44:43 Z Pichon5 Detecting Molecules (IOI16_molecules) C++17
0 / 100
1 ms 384 KB
#include "molecules.h"
#include <bits/stdc++.h>
#define vi vector<int>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w){
    for(int i=0;i<(1<<w.size());i++){
        vi vv;
        for(int j=0;j<w.size();j++){
            if(i&(1<<j)){
                vv.push_back(w[j]);
            }
        }
        int sum=0;
        for(int ll=0;ll<vv.size();ll++){
            sum+=vv[ll];
        }
        if(sum>=l && sum<=u){
            return vv;
        }
    }
    vi v;
    return v;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:8:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |         for(int j=0;j<w.size();j++){
      |                     ~^~~~~~~~~
molecules.cpp:14:24: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         for(int ll=0;ll<vv.size();ll++){
      |                      ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 256 KB Integer 50 violates the range [0, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB OK (n = 1, answer = NO)
2 Correct 0 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 0 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -