답안 #70032

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
70032 2018-08-22T09:33:49 Z evpipis Detecting Molecules (IOI16_molecules) C++11
컴파일 오류
0 ms 0 KB
int main() {
    int n, l, u;
    assert(3 == scanf("%d %d %d", &n, &l, &u));
    std::vector<int> w(n);
    for (int i = 0; i < n; i++)
        assert(1 == scanf("%d", &w[i]));
    std::vector<int> result = find_subset(l, u, w);
    
    
    printf("%d\n", (int)result.size());
    for (int i = 0; i < (int)result.size(); i++)
        printf("%d%c", result[i], " \n"[i == (int)result.size() - 1]);
}

Compilation message

molecules.cpp: In function 'int main()':
molecules.cpp:3:17: error: 'scanf' was not declared in this scope
     assert(3 == scanf("%d %d %d", &n, &l, &u));
                 ^~~~~
molecules.cpp:3:5: error: 'assert' was not declared in this scope
     assert(3 == scanf("%d %d %d", &n, &l, &u));
     ^~~~~~
molecules.cpp:3:5: note: suggested alternative: 'short'
     assert(3 == scanf("%d %d %d", &n, &l, &u));
     ^~~~~~
     short
molecules.cpp:4:10: error: 'vector' is not a member of 'std'
     std::vector<int> w(n);
          ^~~~~~
molecules.cpp:4:17: error: expected primary-expression before 'int'
     std::vector<int> w(n);
                 ^~~
molecules.cpp:6:34: error: 'w' was not declared in this scope
         assert(1 == scanf("%d", &w[i]));
                                  ^
molecules.cpp:7:10: error: 'vector' is not a member of 'std'
     std::vector<int> result = find_subset(l, u, w);
          ^~~~~~
molecules.cpp:7:17: error: expected primary-expression before 'int'
     std::vector<int> result = find_subset(l, u, w);
                 ^~~
molecules.cpp:10:25: error: 'result' was not declared in this scope
     printf("%d\n", (int)result.size());
                         ^~~~~~
molecules.cpp:10:5: error: 'printf' was not declared in this scope
     printf("%d\n", (int)result.size());
     ^~~~~~
molecules.cpp:10:5: note: suggested alternative: 'int'
     printf("%d\n", (int)result.size());
     ^~~~~~
     int