Submission #362644

#TimeUsernameProblemLanguageResultExecution timeMemory
362644mosiashvililukaDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms364 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; long long a,b,c,d,e,i,j,ii,jj,zx,xc,f[200009],jm[200009]; pair <long long, long long> p[200009]; int ka; vector<int> find_subset(int l, int r, vector<int> w) { a=w.size(); for(i=1; i<=a; i++){ p[i].first=w[i-1]; p[i].second=i-1; } sort(p+1,p+a+1); for(i=1; i<=a; i++){ f[i]=p[i].first; jm[i]=jm[i-1]+f[i]; } j=1; for(i=1; i<=a; i++){ while(j<a&&jm[j]-jm[i-1]<l) j++; c=jm[j]-jm[i-1]; if(l<=c&&c<=r){ vector <int> vv; for(ii=i; ii<=j; ii++){ ka=p[ii].second; vv.push_back(ka); } exit(0); } } vector <int> vv; return vv; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...