제출 #423796

#제출 시각아이디문제언어결과실행 시간메모리
423796kwongwengDetecting Molecules (IOI16_molecules)C++17
9 / 100
1 ms292 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef long long ll; #define FOR(i, a, b) for (int i = a; i < b; i++) #define pb push_back vi find_subset(int l, int u, vi w) { vi ans; int n = w.size(); vector<ll> sum; sum.pb(0); FOR(i, 1, n+1){ sum.pb(sum[i-1] + w[i-1]); } FOR(i, 1, n+1){ if (sum[i] > u || sum[n] - sum[n-i] < l) continue; FOR(j, i, n+1){ if (sum[j] - sum[j-i] >= l && sum[j] - sum[j-i] <= u){ FOR(k, j-i, j) ans.pb(k); break; } } break; } 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...