Submission #879912

#TimeUsernameProblemLanguageResultExecution timeMemory
879912_KuroNeko_Detecting Molecules (IOI16_molecules)C++17
0 / 100
1085 ms348 KiB
#include<bits/stdc++.h> // #include <ext/pb_ds/assoc_container.hpp> // #include <ext/pb_ds/tree_policy.hpp> // using namespace __gnu_pbds; // #define ordered_set tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update> // #pragma GCC optimize("O3,unroll-loops") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") using namespace std; typedef long long ll; typedef long double ldb; typedef vector<int> vi; typedef vector<long long> vl; typedef vector<double> vdb; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvl; typedef vector<string> vs; typedef set<int> si; typedef set<long long> sl; typedef set<double> sdb; typedef set<string> ss; typedef set<char> sc; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define ftb(i, a, b) for (int i = a, _b = b; i <= _b; ++i) #define ft(i, a, b) for (int i = a, _b = b; i < _b; ++i) #define fgb(i, a, b) for (int i = a, _b = b; i >= _b; --i) #define fg(i, a, b) for (int i = a, _b = b; i > _b; --i) #define endl "\n" vector<int> find_subset(int l, int u, vi w) { int n = w.size(); vector<pll> a(n); ft(i, 0, n) { a[i].first = w[i]; a[i].second = i; } sort(a.begin(), a.end()); vi ans; int left = 0, right = 0; ll sum = 0; while (right < n) { sum += a[right].first; if (sum < l) { right++; continue; } while (sum > u && left < n) { sum -= a[left].first; left++; } if (sum >= l && sum <= u) { ftb(i, left, right) { ans.push_back(a[i].second); } return ans; } } if (sum >= l && sum <= u) { ftb(i, left, right) { ans.push_back(a[i].second); } return 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...