Submission #1060739

#TimeUsernameProblemLanguageResultExecution timeMemory
1060739kkkkkkkkDetecting Molecules (IOI16_molecules)C++14
100 / 100
38 ms5728 KiB
#include <bits/stdc++.h> using namespace std; vector<int> find_subset(int l, int r, vector<int> w) { int n=w.size(); pair<int,int> a[n]; for (int i=0;i<n;i++) a[i].first=w[i], a[i].second=i; sort(a, a+n); long long zbir=0, index_l=0, index_r=0; vector<int> rez; while (index_r<n) { zbir+=a[index_r].first; while (zbir>r) { zbir-=a[index_l].first; index_l++; } if (zbir>=l) { for (int i=index_l;i<=index_r;i++) rez.push_back(a[i].second); break; } index_r++; } return rez; }
#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...