Comments

answer = min(answer, a[i] ^ b[j] + solve(i + 1, (mask ^ (1 << j)), n, a, b));

Plus operator has higher priority than xor so correct statement should be answer = min(answer, (a[i] ^ b[j]) + solve(i + 1, (mask ^ (1 << j)), n, a, b)); Second thing is dp size should be maximum dp[14][1<<14]. Hope it helps.

My N(LogN)^2 is passing.

Please predict mine as well.

Thanks.

How is the checker implemented for DIANE?

We can not build a square having length greater than sqrt(4*n+m).

Let x=sqrt(4*n+m).

if x is even then the whole x by x grid can be divide into 2 by 2 squares. So we will use the maximum possible 2 by 2 squares and since 4*n+m>=x*x so simply x is the answer.

if x is odd then the maximum possible 2 by 2 squares that can be used is ((x-1)*(x-1))/4; Let val1=((x-1)*(x-1))/4.

So 2 by 2 squares used will be min(val1,n); now if 4*min(val1,n)+m>=x*x then x is answer otherwise x-1 is the answer.

Hope it helps.

+17

I know this but what about this problem?How are you going to apply lazy propagation here?

+17

how?

+4

There is an ABC this sunday.

0

how many problems will be there?

+3

O(2^logn)=O(n)

Even 2*10^6 would have avoided inefficient solutions passing so there was no point for this much strict constraints.

What was your complexity?

I used cin,cout with ios_base in 3rd problem and wrote a O(n) solution and it gave me tle 5 times until i used scanf,printf.There should not be this strict bound on constraints.This is always an issue on codechef.

There are six problemsetters for educational round so setting six problems in a month is not a tough task so you should not feel bad for authors.

print each test-case output in newline.

+116

Problem B was written terribly and also sample explantions were really bad. I won't say that the round should be unrated but it was one of the worst rounds by far in terms of problem statements.

On decoder__ → Atcoder Beginner Contest, 6 years ago
+3

All of them.

I just read the WA code again and again and it works most of the times.

vector<vector> adj when passed as an argument to dfs function makes copies of itself each time recursion is called.On the other hand vector adj[] does not make copies of itself when dfs is called recursively. I think this is the reason.Please Correct me if i am wrong.

+9

sum of n over all test cases does not exceed 1024.

total sequences are 92378 in worst case. C(19,10)=92378

editorial in english is available some days after the contest

test cases for f were too weak

7 1 1 1 1 1 1 1 my program was giving output 4 instead of 3 and yet it got accepted