제출 #572459

#제출 시각아이디문제언어결과실행 시간메모리
572459srlabibDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms212 KiB
#/****Bismillahir rahmanir rahim****/ #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vd; #define All(a) a.begin(), a.end() template <typename T> void get_vector(T &a) { for (auto &e : a) cin >> e; } template <typename T> void put_vector(T a) { for (auto e : a) cout << e << " "; cout << endl; } vector<int> find_subset(int l, int u, vi w) { int n =w.size(); vector<pair<int,int>> a(n); for(int i = 0; i<n ; i++){ a[i] = {w[i],i+1}; } sort(All(a)); ll sum = 0; int i; for(i = 0; i<n; i++){ sum += a[i].first; if(sum>=l)break; } if(sum>u)return {}; vi res(i+1); for(int j = 0; j<=i; j++){ res[j] = a[j].second; } return res; }
#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...