제출 #390411

#제출 시각아이디문제언어결과실행 시간메모리
390411marat0210Detecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector<long long> find_subset(long long l, long long u, vector<long long> w) { vector <long long> res; long long mi = l / w[0]; if (mi * w[0] < l and mi <= w.size()) { if (mi * w[0] + w[0] >= l and mi * w[0] + w[0] <= u and mi + 1 <= w.size()) { for (int i = 0; i < mi + 1; ++i) { res.push_back(i); } } } else if (mi * w[0] >= l and mi * w[0] <= u and mi <= w.size()) { for (int i = 0; i < mi; ++i) { res.push_back(i); } } return res; }

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

molecules.cpp: In function 'std::vector<long long int> find_subset(long long int, long long int, std::vector<long long int>)':
molecules.cpp:9:30: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     if (mi * w[0] < l and mi <= w.size()) {
      |                           ~~~^~~~~~~~~~~
molecules.cpp:10:72: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         if (mi * w[0] + w[0] >= l and mi * w[0] + w[0] <= u and mi + 1 <= w.size()) {
      |                                                                 ~~~~~~~^~~~~~~~~~~
molecules.cpp:16:55: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     else if (mi * w[0] >= l and mi * w[0] <= u and mi <= w.size()) {
      |                                                    ~~~^~~~~~~~~~~
/tmp/cc1fs39c.o: In function `main':
grader.cpp:(.text.startup+0x139): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status