Submission #972729

#TimeUsernameProblemLanguageResultExecution timeMemory
972729vjudge1Detecting Molecules (IOI16_molecules)C++11
Compilation error
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){ int n=w.size(); pair<int,int>w1[n+1]; for(int i=0;i<n;i++){ w1[i].F=w[i]; w1[i].S=i; } sort(w1,w1+n); int l1=0,r1=0,sum=w1[0].F; vector<int>ans; while(l1<n&&r1<n){ 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; l1++; } } 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

Compilation message (stderr)

/usr/bin/ld: /tmp/cc7vRnRy.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