Good morning, day, evening, night to you.
Welcome to the wonderful randomized contest, which is prepared for you by team Saratov SU 3 (Davtyan Edvard, Kholkin Pavel, Kudryashov Igor).
Thanks to Julia Satushina, Artem Rakhov and Dmitry Matov for their help in preparing this round. Special thanks to VK company.
Good luck and high rating!
With best regards, Saratov SU 3.
I also want to know the spected solution for problem B.What is wrong in this idea?I have used a combination of printf and cout. Will that be a problem?
4
bbbb
or
10
4
bbbb
// in the main function
if(strlen(sa)!=strlen(sb)){
puts("-1");
return -1;
}
Unfortunately, my code is always getting Runtime Error for test 3.
However, if "return 0" replace "return -1", I get Accepted.
Why?
sorry for my poor English!Thanks!
In that case, O(MK) solution will get TLE, and problem D can be a bit harder to get accepted.
Print the maxSum;
PS: Sorry for my poor English...
3
-1 -2 -3
there are many possible answers:
(1) -1 -2 -3 sum= -6 (here the prefix is empty and suffix is empty)
(2) -1 -2 3 sum=0 (here the prefix is empty and suffix is {-3}, multiply by -1 become {3})
(3) -1 2 3 sum=4 (here the prefix is empty and suffix is {-2 -3}, multiply by -1 become { 2 3} )
(4) 1 2 3 sum=6 (this is the maximum possible answer, prefix is empty and suffix is {-1 -2 -3} multiply by -1 become {1 2 3})
etc
*for all numbers in the prefix and suffix, multiply all numbers in prefix and suffix by -1. so for test case:
Hope that this help :http://codeforces.me/blog/entry/735
Test case 1 in final test of problem E is same as example test 1. Right or wrong?