답안 #234159

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
234159 2020-05-23T12:28:26 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);
            	R.push_back(j);
            	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++)
                      ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 256 KB sum of weights should be in [302..304] but it is 101
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 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 -