Submission #477899

#TimeUsernameProblemLanguageResultExecution timeMemory
477899FidiskDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; #define oo 1e9 #define fi first #define se second #define sp(iiii) setprecision(iiii) #define IO ios_base::sync_with_stdio(false); cin.tie(0) #define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa)) #define cntbit(xxxx) __builtin_popcount(xxxx) #define getbit(xxxx,aaaa) (((xxxx)>>(aaaa-1))&1) typedef long double ld; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<pair<int,int>,int> piii; typedef pair<pair<int,int>,pair<int,int>> piiii; typedef pair<long long,long long> pll; typedef pair<pair<long long,long long>,long long> plll; typedef pair<pair<long long,long long>,pair<long long,long long>> pllll; typedef pair<pair<long long,long long>,bool> pllb; typedef pair<long double,long double> pld; typedef pair<pair<long double,long double>,long double> plld; typedef pair<long double,long long> pdl; const ll base=361; const ll mod=1e9; const ll mod2=1e9; const ld eps=1e-3; const ld eps2=1e-7; const ll maxn=2e5+9; const ll maxsize=6e5+29; const ld pi=acos(-1); //const ll delta=1e5+7; const int dx[4]={1,-1,0,0}; const int dy[4]={0,0,1,-1}; const int dxkn[8]={1,1,2,2,-1,-1,-2,-2}; const int dykn[8]={2,-2,1,-1,2,-2,1,-1}; const int dxki[8]={1,1,1,0,0,-1,-1,-1}; const int dyki[8]={1,0,-1,1,-1,1,0,-1}; vector<ll> solvesub1(ll l,ll u,vector<ll> w) { vector<ll> kq; kq.clear(); ll sum=0; for (ll i=0;i<w.size();i++) { sum+=w[i]; if (l<=sum&&sum<=u) { return kq; } } return {}; } std::vector<ll> find_subset(ll l, ll u, std::vector<ll> w) { vector<ll> kq; kq.clear(); sort(w.begin(),w.end()); if (w[0]==w.back()) { return solvesub1(l,u,w); } return kq; } int main() { IO; #ifndef ONLINE_JUDGE freopen("test.inp", "r", stdin); freopen("test.out", "w", stdout); #else #endif }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<long long int> solvesub1(ll, ll, std::vector<long long int>)':
molecules.cpp:49:18: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |     for (ll i=0;i<w.size();i++) {
      |                 ~^~~~~~~~~
molecules.cpp: In function 'int main()':
molecules.cpp:71:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   71 |         freopen("test.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
molecules.cpp:72:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   72 |         freopen("test.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/cc3srSPw.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccxVAiwy.o:molecules.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/cc3srSPw.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