Submission #1084018

#TimeUsernameProblemLanguageResultExecution timeMemory
1084018MighilonDetecting Molecules (IOI16_molecules)C++17
69 / 100
34 ms4184 KiB
#include <bits/stdc++.h> using namespace std; #ifdef DEBUG #include "../Library/debug.h" #else #define dbg(x...) #endif typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define F0R(i, a) for (int i = 0; i < (a); ++i) #define FORd(i, a, b) for (int i = (b) - 1; i >= (a); --i) #define F0Rd(i, a) for (int i = (a) - 1; i >= 0; --i) #define trav(a, x) for (auto& a : x) #define f first #define s second #define pb push_back #define sz(x) (int)(x).size() #define all(x) x.begin(), x.end() const char nl = '\n'; const int INF = 1e9; const int MOD = 998244353; #include "molecules.h" vi find_subset(int u, int l, vi a){ int n = sz(a); int sum = 0; vi p(n); F0R(i, n) p[i] = i; sort(all(p), [&](int i, int j){return a[i] < a[j];}); sort(all(a)); for(int i = 0, j = 0; i < n; ++i){ sum += a[i]; while(sum > l) sum -= a[j++]; if(sum >= u && sum <= l){ vi ans; FOR(k, j, i + 1) ans.pb(p[k]); return ans; } } vi 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...