Submission #958929

#TimeUsernameProblemLanguageResultExecution timeMemory
958929IUA_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]; } 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){ for(int k=i; k<=j; k++){ ans.push_back(w[i]); } } } } 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...