제출 #772910

#제출 시각아이디문제언어결과실행 시간메모리
772910teokakabadzeDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms300 KiB
#include "molecules.h" #include<bits/stdc++.h> #define pb push_back using namespace std; int s, e, sum, i; std::vector<int> find_subset(int l, int u, std::vector<int> w) { vector<int> v; int n = w.size(); sort(w.begin(), w.end()); s = 0, e = 0, sum = w[0]; bool f = 1; while(f) { //cout << s << ' ' << e << ' ' << sum << '\n'; if(sum >= l && sum <= u) { for(i = s; i <= e; i++) v.pb(i); return v; } f = 0; while(e < n && sum < l) sum += w[++e], f = 1; while(s < e && sum > u) sum -= w[s++], f = 1; } return v; }
#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...