Submission #234160

# Submission time Handle Problem Language Result Execution time Memory
234160 2020-05-23T12:29:33 Z Amy313 Detecting Molecules (IOI16_molecules) C++14
0 / 100
5 ms 384 KB
#include "molecules.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> find_subset(int l, int u, std::vector<int> w)
{
	int s;
    vector<int> R;
    R.clear();
    for(int i=0; i<w.size(); i++)
    {
    	s = 0;
        for(int j=i; j<w.size(); j++)
        {
        	s+=w[j];
            if(s>=l and s<=u)
            {
            	R.push_back(i+1);
            	R.push_back(j+1);
            	return R;
            }
        }
    }
    return R;
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:9:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0; i<w.size(); i++)
                  ~^~~~~~~~~
molecules.cpp:12:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int j=i; j<w.size(); j++)
                      ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 2 violates the range [0, 1]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB sum of weights should be in [302..304] but it is 101
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 2 violates the range [0, 1]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 2 violates the range [0, 1]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 2 violates the range [0, 1]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 384 KB OK (n = 1, answer = NO)
2 Correct 4 ms 256 KB OK (n = 1, answer = NO)
3 Incorrect 5 ms 256 KB Integer 2 violates the range [0, 1]
4 Halted 0 ms 0 KB -