Submission #1002149

#TimeUsernameProblemLanguageResultExecution timeMemory
1002149aykhnDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms600 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define OPT ios_base::sync_with_stdio(0); \ cin.tie(0); \ cout.tie(0) #define pii pair<int,int> #define pll pair<ll,ll> #define endl "\n" #define all(v) v.begin(), v.end() #define mpr make_pair #define pb push_back #define ts to_string #define fi first #define se second #define inf 0x3F3F3F3F #define bpc __builtin_popcount #define print(v) for(int i = 0; i < v.size(); i++) \ cout << v[i] << " "; \ cout<<endl; vector<int> find_subset(int lx, int u, vector<int> arr) { int n = arr.size(); int l = 0; int r = 0; vector<pii> w; for (int i = 0; i < n; i++) { w.pb({arr[i], i}); } ll sum = 0; while (r < n) { sum = sum + w[r].fi; while (sum > u) { sum = sum - w[l].fi; l++; } if (sum >= lx && sum <= u) { vector<int> ans; for (int i = l; i <= r; i++) { ans.pb(w[i].se); } sort(all(ans)); return ans; } r++; } vector<int> ans; return ans; }
#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...