Submission #70032

#TimeUsernameProblemLanguageResultExecution timeMemory
70032evpipisDetecting Molecules (IOI16_molecules)C++11
Compilation error
0 ms0 KiB
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 (stderr)

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