Submission #297761

#TimeUsernameProblemLanguageResultExecution timeMemory
297761emnikDetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms256 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; #define pb push_back #define all(x) begin(x), end(x) #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); std::vector<int> find_subset(int l, int r, vector<int> W){ vector<int> a, b; vector<pair<int, int>> Pair; for(int i=0; i < (int)W.size(); i++){ Pair.pb({W[i], i+1}); } sort(Pair.begin(), Pair.end()); for(int i=0; i < (int)Pair.size(); i++){ int flag=0; a.clear(); a.pb(Pair[i].second); int sum = Pair[i].first; for(int j=i+1; j < (int)Pair.size(); j++){ if(sum >= l && sum <= r){ flag=1; break; } sum += Pair[j].first; a.pb(Pair[j].second); } if(flag) b=a; } return b; }
#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...