Comments

You can run your code on the server-side. Use “custom test” tab in the contest dashboard.

You must normalize pref array like this way: for(int i = pref.length - 2; i >= 0; i--) pref[i] = min(pref[i], pref[i + 1]);

You must do the same for suff array.

On ConnectorCodeforces Beta Round #64, 14 months ago
+5
map<pair<int, int>, int>

pair<int, int> means a fraction first/second. You must divide first and second into gcd.
On cauchykFacebook Hacker Cup 1A, 16 months ago
0
Nice =)
On cauchykFacebook Hacker Cup 1A, 16 months ago
0
Can you explain your solution?
On cauchykFacebook Hacker Cup 1A, 16 months ago
+5
Why is it correct?

Gauss method may be used, if there are unique solution (determinant != 0). In another case, there are multiple solution (maybe, no solution). How are you choose the minimal answer?

In my opinion, you're wrong.

So, I think bruteforce is correct way to solve.
Sorry. fixed.
Don't worry. Round will be rated for them too.

People, who are considered out of competition, are participants of Codeforces Round #38, others are participants of School Personal Contest #1.

But we will use merged result table for updating rating.
On NALPCodeforces Beta Round #19, 23 months ago
0
use printf("%I64d\n", ans);