제출 #1019869

#제출 시각아이디문제언어결과실행 시간메모리
1019869vjudge1Detecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
 #include<bits/stdc++.h>
 
#define int long long
 
#define vi vector<long long>
#define vvi vector<vi>
#define pi pair<long long, long long>
#define vpi vector<pi>
#define loop(a, b) for(long long a = 0;a<b;a++)
#define all(a) a.begin(), a.end()
 
#define space << " " <<
 
#define flase false
#define fasle flase
 
using namespace std;
 
const int VeryBigNumber = 1e18 + 42 + 1;
const int VeryNiceNumber = 420 + 69;

vi find_subset(int l, int u, vi w){
    int wnow = 0;
    loop(i, w.size()){
        wnow += w[i];
        if (wnow <= u and wnow >= l){
            vi ans = {};
            loop(j, i){
                ans.push_back(j);
            }
            return ans;
        }
    }
}

/*

l < k*Wi < u

*/

컴파일 시 표준 에러 (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:41: 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 | #define loop(a, b) for(long long a = 0;a<b;a++)
......
   24 |     loop(i, w.size()){
      |          ~~~~~~~~~~~                     
molecules.cpp:24:5: note: in expansion of macro 'loop'
   24 |     loop(i, w.size()){
      |     ^~~~
molecules.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
/usr/bin/ld: /tmp/cclFicUO.o: in function `main':
grader.cpp:(.text.startup+0x18d): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status