제출 #501594

#제출 시각아이디문제언어결과실행 시간메모리
501594dnauxDetecting Molecules (IOI16_molecules)C++17
19 / 100
1 ms204 KiB
#include <bits/stdc++.h> #include "molecules.h" #define endline "\n" #define pb push_back #define mp make_pair #define st first #define nd second #define lsb(i) i&(-i) #define sz(i) (int)i.size() typedef long long ll; using namespace std; const ll INF = 1e18L; constexpr int mod = int(1e9) + 7; ll t=1, n, m, k, q, s, cases = 0, timee = 0; vector<int> find_subset(int l, int u, vector<int> ar){ n = sz(ar); ll sum = ar[0]; for(int i = 0, j = 0;i < n or j < n;){ if(sum >= l and sum <= u){ vector<int> ans; for(int k = i; k <= j; k++){ ans.pb(k); } return ans; } else if(sum < l){ if(j - 1 < n){j++;sum += ar[j];} else{ vector<int> ans;return ans; } } else if(sum > u){ if(i - 1 < n){ sum -= ar[i]; i++; } else{ vector<int> ans;return ans; } } } vector<int> 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...