제출 #958931

#제출 시각아이디문제언어결과실행 시간메모리
958931IUA_HasinDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> #define endl "\n" #define yeap cout<<"YES"<<endl #define nope cout<<"NO"<<endl #define ll long long using namespace std; #include "molecules.h" std::vector<int> find_subset(int l, int u, std::vector<int> w) { ll n = w.size(); ll arr[n+1]; arr[0] = 0; for(int i=0; i<n; i++){ arr[i+1] = arr[i]+w[i]; } ll q = -1; vector<int> ans; for(int i=0; i<n; i++){ for(int j=i; j<n; j++){ ll a = arr[i-1]; ll b = arr[j]; ll c = b-a; if(c>=l && c<=u){ q=1; for(int k=i; k<=j; k++){ ans.push_back(w[k]); } } } } if(q==-1){ return std::vector<int>(0); } else { 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...