Submission #972266

#TimeUsernameProblemLanguageResultExecution timeMemory
972266vjudge1Detecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define pon ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  int T=1;
#define ponchik signed main
#define pb push_back
#define pf push_front
#define endl "\n"
#define F first
#define S second

const int N=1e5+69,INF=1e18+1488;
void solve() {
	int n,a,b;
	cin>>n>>a>>b;
	int w[n+7];
	for (int i=0; i<n; i++) cin>>w[i];
	sort(w,w+n);
	int l=0,r=0,sum=w[0];
	while (l<=r&&l<n) 
	{
		if (sum>=a&&sum<=b)
		{
			for (int i=l; i<=r; i++) cout<<w[i]<<" ";
			return;
		}
		if (sum+w[r+1]<a) r++,sum+=w[r];
		else if (sum+w[r+1]>b) l++,sum-=w[l-1];
	}
	cout<<0;
}

ponchik (/*Alfar ABI*/ ) {
    pon
//  freopen( "###.in" ,"r",stdin); freopen( "###.out" ,"w",stdout);
//	cin>>T;
	while (T--){solve();}
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccnGzR3L.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc3GhQeL.o:molecules.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccnGzR3L.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