제출 #972720

#제출 시각아이디문제언어결과실행 시간메모리
972720vjudge1Detecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include <sstream> #include "molecules.h" using namespace std; #define accepted ios_base::sync_with_stdio(false);cin.tie(nullptr); #define Daulbekov signed #define Makan main #define int long long #define double long double #define pb push_back #define pf push_front #define F first #define S second const int N=2e5+7; const int MAX=9e18+7; const int INF=1e18; vector<int>find_subset(int l,int u,vector<int>w){ pair<int,int>w1[w.size()+1]; for(int i=0;i<w.size();i++){ w1[i].F=w[i]; w1[i].S=i; } sort(w1,w1+w.size()); int l1=0,r1=0,sum=w1[0].F; vector<int>ans; while(l1<w.size()&&r1<w.size()){ if(l<=sum&&sum<=u){ for(int i=l1;i<=r1;i++)ans.pb(w1[i].S); break; } else if(l>sum){ r1++; sum+=w1[r1].F; } else if(sum>u){ sum-=w1[l1].F; l++; } } return ans; } //Daulbekov Makan(){ // accepted; // //} // 2 2 4 // 2 2 2 // 3 2 1 3 2 1 3 3 // 3 2 1 3 2 1

컴파일 시 표준 에러 (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:19:15: 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]
   19 |  for(int i=0;i<w.size();i++){
      |              ~^~~~~~~~~
molecules.cpp:26:10: 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]
   26 |  while(l1<w.size()&&r1<w.size()){
      |        ~~^~~~~~~~~
molecules.cpp:26:23: 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]
   26 |  while(l1<w.size()&&r1<w.size()){
      |                     ~~^~~~~~~~~
/usr/bin/ld: /tmp/cccYIL59.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