제출 #868305

#제출 시각아이디문제언어결과실행 시간메모리
868305LOLOLODetecting Molecules (IOI16_molecules)C++14
0 / 100
1 ms348 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; #define f first #define s second #define pb push_back #define ep emplace #define eb emplace_back #define lb lower_bound #define ub upper_bound #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define uniquev(v) sort(all(v)), (v).resize(unique(all(v)) - (v).begin()) #define mem(f,x) memset(f , x , sizeof(f)) #define sz(x) (int)(x).size() #define __lcm(a, b) (1ll * ((a) / __gcd((a), (b))) * (b)) #define mxx *max_element #define mnn *min_element #define cntbit(x) __builtin_popcountll(x) #define len(x) (int)(x.length()) const int N = 1e6 + 100; ll a[N]; vector <int> find_subset(int l, int r, vector <int> arr) { vector <pair <ll, ll>> v; for (int i = 0; i < sz(arr); i++) v.pb({arr[i], i}); sort(all(v)); vector <int> lst; ll s = 0, st = 0; for (int j = 0; j < sz(v); j++) { s += v[j].f; while (s > r) { s -= v[st].f; st++; } if (s >= l) { for (int f = st; f <= j; f++) { lst.pb(v[f].s); } return lst; } } return {0}; }
#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...