Hey, I have been stuck at this problem for quite long [problem:327E]. According to the editorial the author specified an approach involving "meet in the middle", but my implementation caused a TLE [submission:76646016]. Then he had mentioned that a bitmask DP approach of O(n*(2^n)) somehow unintentionally manages to pass the test cases & referenced to a particular submission [submission:4017915]. I had gone through the code but once again when implemented it caused a TLE. To figure out the reason behind this I tried to step by step make my code similar to the AC submission ( [submission:4017915] ) mentioned in the editorial but again failed at the end with my submission as: [submission:76648464].↵
↵
Any kind of help would be appreciated.↵
↵
Edit: This issue has been solved by converting all long long to int everywhere.
↵
Any kind of help would be appreciated.↵
↵
Edit: This issue has been solved by converting all long long to int everywhere.