제출 #1217077

#제출 시각아이디문제언어결과실행 시간메모리
1217077moondarksideDetecting Molecules (IOI16_molecules)C++20
컴파일 에러
0 ms0 KiB
vector<int> find_subset( int l, int u, vector<int> w ) {
    sort(w.begin(),w.end());
    if(w[0]>u){
        return vector<int>();
    }
    int weight=0;
    std::queue<int> Solution;
    for(int i=0;i<w.size();i++){
        if(weight>=l && weight<=u){
            vector<int> Sol;
            while(!Solution.empty()){
                Sol.push_back(Solution.front());
                Solution.pop();
            }
            return Sol;
        }
        
        if(weight<l){
            Solution.push(i);
            weight+=w[i];
        }
        else{
            weight-=w[Solution.front()];
            Solution.pop();
        }
    
    }
    return vector<int>();
    
}

컴파일 시 표준 에러 (stderr) 메시지

molecules.cpp:1:1: error: 'vector' does not name a type
    1 | vector<int> find_subset( int l, int u, vector<int> w ) {
      | ^~~~~~
molecules.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
molecules_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~