I didn't use backtracking for this problem.
It can be done by means of DP on subsets.
For each subset and for each partition by two of this subset multiply, add, subtract and divide the elements of each partition.
Hope this helps.
Search found 38 matches
- Sat Mar 17, 2007 4:51 pm
- Forum: Volume 111 (11100-11199)
- Topic: 11190 - Series of Powers
- Replies: 18
- Views: 11383
I'm always getting TLE. Is there a better method than O(nlogk). My code is the following (I will remove it after AC if I'm able to do that). I have tried all the dirty tricks I could imagine without success: #include <iostream> #include <iomanip> #include <stdio.h> #include <cmath> using namespace s...