답안 #108207

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
108207 2019-04-28T05:39:29 Z tictaccat Detecting Molecules (IOI16_molecules) C++14
0 / 100
2 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 n = w.size();

    vector<int> res;
    int s = 0;

    while (s + w[0] <= u && res.size() < n) {
        s += w[0];
        res.push_back(w[0]);
    }

    if (s >= l) return res;

    return std::vector<int>();
}

Compilation message

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:14:40: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while (s + w[0] <= u && res.size() < n) {
                             ~~~~~~~~~~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB OK (n = 1, answer = NO)
2 Correct 2 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Contestant can not find answer, jury can
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB OK (n = 1, answer = NO)
2 Correct 2 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB OK (n = 1, answer = NO)
2 Correct 2 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB OK (n = 1, answer = NO)
2 Correct 2 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB OK (n = 1, answer = NO)
2 Correct 2 ms 384 KB OK (n = 1, answer = NO)
3 Incorrect 2 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -