제출 #1299610

#제출 시각아이디문제언어결과실행 시간메모리
1299610alexiahDetecting Molecules (IOI16_molecules)C++20
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; vector<long long> find_subset(long long l, long long u, vector<long long> w) { long long n = w.size(); vector<pair<long long , long long>> v(n); for(long long i = 0; i < n; i++){ v[i].first = w[i]; v[i].second = i; } sort(v.begin() , v.end()); long long count = v[0].first; long long ini = 0 , fin = 0; while(true){ if(ini > fin){ fin++; count += v[fin].first; } if(count > u){ count -= v[ini].first; ini++; } else if(count < l){ fin++; if(fin >= n){ return {}; } count += v[fin].first; } if(count >= l && count <= u){ vector<long long> ans; for(; ini <= fin; ini++) ans.push_back(v[ini].second); return ans; } } return {}; }

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

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
      |         ^~~~
/usr/bin/ld: /tmp/ccFtWom1.o: in function `main':
grader.cpp:(.text.startup+0x165): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status