Comments
+8

I didn't solve F but one of the obseervations i made was that if both a and b divide k you can "sacrifice" 1 out of 3 pancakes to cook the ones beside it. For example t = 1: (1 2 0) t = 2: (2 4 0) t = 3: (2 5 2)

0

You can actually prove that the snake of size 2i-1 starts in a cell which is n-i cells away from (1, 1) and ends in a cell n-i cells away from (n, n), it would then follow quite trivially that its middle point its on the middle diagonal. To prove this you can see that a snake doesnt occupy more than one cell on each diagonal (of those defined by r + c = i, where this represents the i-th diagonal), then since there are 2N-1 diagonals the biggest snake must occupy at least one cell of each one then the remaining diagonals are equivalents to the ones on a (N-1) X (N-1) grid. Thus by induction the snake of size 2i-1 must start at the diagonal mentioned.

I find it strange that the intended solution for C was not to just simulate the process (or that no one else mentioned a similar solution). My solution 375495693 did just that in O(nlog(n)log(C)). It simulates in a greedy way using a priority queue while keeping track of the smallest and biggest element and exiting the simulation once the smallest value was one less than the biggest (a special case for 1, 2 was needed tho).

I guess this goes to show how bad the maps are.

On xoxoCodeforces Round 1099 (Div. 2), 4 months ago
0

omg your absolutely right this is not cubic, thnx

On xoxoCodeforces Round 1099 (Div. 2), 4 months ago
0

For problem E did you use fft or something to calculate the convolution or did you not have to calculate it at all?

Hi the link to the contest I got by mail says it starts at 9AM UTC instead of 1PM UTC

On ismailfateenICPC WF 2026 Team List, 6 months ago
+13

Latin America, Chile, Universidad de Chile, sin globito no hay fiesta, m1tu dariasc MartinRT

On KANCodeforces Round 1069, 10 months ago
0

Look at the announcements for the round, the problems are from a contest that is still going and they said in the announcements that upsolving wouldnt be available until 3 hours after the CF round ended

On KANCodeforces Round 1069, 10 months ago
0

when working with xor in ranges is always useful to think about the prefix xor, let pref[i] be the prefix xor of the array up to i with pref[0] = 0 then a subarray a[l:r] has xor pref[l-1]^pref[r]. Try constructing the prefix xor first. This is enough as a hint I think, if you want a full explanation of my solution just ask.

In many problems with xor in subarrays is often much simpler to only think about the prefix xor.

On KANCodeforces Round 1069, 10 months ago
0

I think i found the mistake, it is when you take a part of the second half of B and the last term from the first part, like if n = 16 l = 1 r = 16, then your code outputs 4 5 6 8 9 10 11 12 4 5 6 8 9 10 11 12, but the array 12 4 5 6 8 9 10 has xor 0

On KANCodeforces Round 1069, 10 months ago
0

what if region B has an odd length? you algorithm implies that the length of B is even (or am i missing something?)