Submission #1097887

#TimeUsernameProblemLanguageResultExecution timeMemory
1097887dzhoz0Detecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms604 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; // #define int long long vector<int> sub1(int l, int u, vector<int> w) { int n = w.size(); int cur = 0; vector<int> res; for(int i = 0; i < n; i++) { cur += w[i]; res.push_back(i); if(cur >= l && cur <= u) { return res; } } return vector<int>(0); } vector<int> find_subset(int l, int u, vector<int> w) { int n = w.size(); sort(w.begin(), w.end()); if(n <= 100 && w[n - 1] <= 100 && w[0] == w[n - 1]) { return sub1(l, u, w); } return vector<int>(0); }
#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...