제출 #573334

#제출 시각아이디문제언어결과실행 시간메모리
573334talant117408Detecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms304 KiB
#include "molecules.h" #ifndef EVAL #include "grader.cpp" #endif #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <int, int> pii; typedef pair <ll, ll> pll; #define pb push_back #define mp make_pair #define all(v) (v).begin(),(v).end() #define rall(v) (v).rbegin(),(v).rend() #define sz(v) int((v).size()) #define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define endl '\n' int mod = 1e9+7; ll modulo(ll a) { return ((a % mod) + mod) % mod; } ll add(ll a, ll b) { return modulo(a + b); } ll mult(ll a, ll b) { return modulo(a * b); } ll binpow(ll a, ll b) { ll res = 1; while (b) { if (b&1) { res = mult(res, a); } a = mult(a, a); b >>= 1; } return res; } vector<int> find_subset(int L, int R, vector<int> w) { int l = 0; ll sum = 0; sort(all(w)); for (int r = 0; r < sz(w); r++) { sum += w[r]; while (sum > R) { sum -= w[l]; l++; } if (L <= sum && sum <= R) { vector <int> ans(r-l+1); iota(all(ans), l); return ans; } } return vector <int> (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...