답안 #282106

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
282106 2020-08-24T03:03:29 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;
vector<int> find_subset(int l, int u,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;
        }
    }
    return vector<int>();
}

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++){
      |                      ~~^~~~~~~~~~
# 결과 실행 시간 메모리 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 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 256 KB Integer 50 violates the range [0, 11]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 1 ms 256 KB Integer 10 violates the range [0, 0]
4 Halted 0 ms 0 KB -