제출 #872531

#제출 시각아이디문제언어결과실행 시간메모리
872531ZeroDetecting Molecules (IOI16_molecules)C++17
0 / 100
0 ms600 KiB
#include <bits/stdc++.h> #define ll long long #include "molecules.h" #define pb push_back using namespace std; vector<int> find_subset(int l, int u, vector<int> a){ ll n = a.size(); vector<int> v; ll s = 0; for(ll i=0; i < n; i ++){ if(a[i]>=l && a[i] <= u){ v.pb(i); return v; } } int j = 0; for(int i=0; i < n; i ++){ s += a[i]; if(s >= l && s <= u) { v.pb(j); v.pb(i); return v; } if(s >= u) s-= a[j],j++; } return v; } // signed main(){ // int l,u; cin >> l >> u; // vector<int> a(4); // for(auto &i : a) cin >> i; // vector<int> y = find_subset(l,u,a); // for(auto i : y) cout << i << " "; // 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...