Submission #425888

#TimeUsernameProblemLanguageResultExecution timeMemory
425888vincentpikachu20Detecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms204 KiB
#include "molecules.h" #include <bits/stdc++.h> #define int long long using namespace std; vector<signed> find_subset(signed _l, signed _u, vector<signed> _w) { int l = _l, u = _u; vector<int> w(_w.begin(), _w.end()); sort(w.begin(), w.end()); u = min(u,accumulate(w.begin(), w.end(), (int)0)); int n = w.size(); // int k = (l+w[0]-1)/w[0]; if(k*w[0] > u) return vector<signed>(); else{ vector<signed> a(k); for(int i = 0; i < k; i ++) a[i] = i; return a; } }

Compilation message (stderr)

molecules.cpp: In function 'std::vector<int> find_subset(int, int, std::vector<int>)':
molecules.cpp:11:9: warning: unused variable 'n' [-Wunused-variable]
   11 |     int n = w.size();
      |         ^
#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...