제출 #783913

#제출 시각아이디문제언어결과실행 시간메모리
783913AlfraganusDetecting Molecules (IOI16_molecules)C++14
69 / 100
35 ms4912 KiB
#include "molecules.h" // #include "grader.cpp" #include<bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() vector<int> find_subset(int l, int u, vector<int> w) { int n = w.size(), j = 0, i = 0, s = 0; vector<pair<int, int>> a(n); for(int i = 0; i < n; i ++)a[i] = {w[i], i}; sort(all(a)); while(i < n){ s += a[i].first; i ++; while(s > u)s -= a[j ++].first; if(l <= s and s <= u){ vector<int> ans; for(int x = j; x < i; x ++){ ans.push_back(a[x].second); } return ans; } } return {}; }
#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...