Submission #378016

#TimeUsernameProblemLanguageResultExecution timeMemory
378016hackermubDetecting Molecules (IOI16_molecules)C++17
0 / 100
79 ms65540 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; //#define int long long #define pii pair<int,int> #define float long double #define fi first #define se second #define pb push_back #define all(v) v.begin(),v.end() #define sz(v) (int)v.size() std::vector<int> find_subset(int l, int u, std::vector<int> w) { int n=sz(w); vector<pii> v; for(int i=0;i<n;i++){ v.pb({w[i],i}); } int sum=0; vector<int> ans; for(int i=0,j=0;j<n;j++){ sum+=v[j].fi; while(sum>u){ sum-=v[i].fi; i++; } if(l<=sum){ while(i<=j){ ans.pb(v[i].se); } break; } } return ans; }
#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...