제출 #909957

#제출 시각아이디문제언어결과실행 시간메모리
909957stefanneaguDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector<int> find_subset(int l, int r, vector<int> w) { vector<pair<int, int>> v; int n = w.size(); v.push_back({0, 0}); for(int i = 1; i <= n; i ++) { v.push_back({w[i - 1], i}); } sort(v.begin(), v.end()); int sum = 0; for(int i = 1, j = 1; i <= n; i ++) { sum += v[i].first; while(sum > r) { sum -= v[j].first; j ++; } if(sum >= l) { vector<int> ans; for(int ind = j; ind <= i; ind ++) { ans.push_back(v[ind].second); } return ans; } } vector<int> am_belit_coaiele; return am_belit_coaiele; }
#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...