Submission #775133

#TimeUsernameProblemLanguageResultExecution timeMemory
775133CutebolDetecting Molecules (IOI16_molecules)C++17
0 / 100
1 ms296 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; set <int> vec ; map <int , vector <int> > mp ; vector<int> find_subset( int l , int r , vector<int> a ){ vec.insert(0) ; vector <int> ans ; int n = a.size() , f = 0 ; for ( int i = 0 ; i < n ; i ++ ){ vector <int> cur ; for ( auto j : vec ){ if ( j + a[i] <= r && vec.find(j+a[i]) == vec.end() ) cur.push_back(j) ; } for ( auto j : cur ){ vec.insert(j+a[i]) ; mp[j+a[i]] = mp[j] ; mp[j+a[i]].push_back(i+1) ; if ( l <= j+a[i] && j+a[i] <= r ){ ans = mp[j+a[i]] ; f = 1 ; break ; } } if (f) 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...