Submission #341407

#TimeUsernameProblemLanguageResultExecution timeMemory
341407Killer2501Detecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms364 KiB
#include <bits/stdc++.h> #define pb push_back #define vii vector<int> #define task "LAZY" #define pll pair<ll, ll> #define pii pair< pll, ll > #define fi first #define se second using namespace std; using ll = int; using ull = unsigned long long; const int N = 1e6+5; const ll mod = 1e9+7; const ll base1 = 1313; const ll base2 = 3113; ll m, n, k, t, T, ans, u, v, tong; pll a[N], b[N]; vector<ll> kq; vector<int> find_subset(int l, int u, vector<int> w) { n = w.size(); for(int i = 1; i <= n; i ++) { a[i].fi = w[i-1]; a[i].se = i; } sort(a+1, a+1+n); int j = 1; for(int i = 1; i <= n; i ++) { tong += a[i].fi; if(tong > u)tong -= a[j].fi, ++j; if(tong >= l) { for(int id = j; id <= i; id ++)kq.pb(a[i].se); return kq; } } return kq; }
#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...