제출 #875707

#제출 시각아이디문제언어결과실행 시간메모리
875707nasir_bashirovDetecting Molecules (IOI16_molecules)C++11
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define db long double #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define vi vector<int> #define vl vector<ll> #define vii vector<pii> #define vll vector<pll> #define endl '\n' #define all(x) x.begin(), x.end() #define fastio\ ios_base::sync_with_stdio(0);\ cin.tie(0);\ cout.tie(0)\ vl find_subset(ll x, ll y, vl w) { vl org = w; sort(all(w)); ll s = 0, l = 0; for(int i = 0; i < w.size(); i++){ s += w[i]; while(l < i and s > y){ s -= w[l]; l++; } if(s >= x and s <= y){ vl res; map<ll, ll> cnt; for(int j = l; j <= i; j++) cnt[w[j]]++; for(int j = 0; j < w.size(); j++){ if(cnt[org[j]]) res.push_back(j), cnt[org[j]]--; } return res; } } vl res; 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:24:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |     for(int i = 0; i < w.size(); i++){
      |                    ~~^~~~~~~~~~
molecules.cpp:34:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |             for(int j = 0; j < w.size(); j++){
      |                            ~~^~~~~~~~~~
/usr/bin/ld: /tmp/cc9Vw8Gn.o: in function `main':
grader.cpp:(.text.startup+0x13d): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status