On awoo → Educational Codeforces Round 124 Editorial, 2 years ago 0 Bug in my solution of D?Iterate over all points, if the answer for this point is yet to found then call function rec(Pi) from this point. Description of rec(Pi) function:Case 1: if Pi has any adjacent cell which is not in the input, set it as the answer for Pi and return.Case 2: if all adjacent cells of Pi is present in the input, call rec function for the adjacent cells if there answers are yet to found. And then choose answer for Pi among the 4 adjacent cells answers(choose the one with shortest Manhattan distance).code: here
 On Petar → CROC-MBTU 2012, Elimination Round — Editorial, 3 years ago 0 In problem H, submitting even the editorial implementation gives TLE on test case 5.[Not even using "\n" instead of endl].
 On mohammedehab2002 → Codeforces Round #717 (Div.2), 3 years ago +1 Hoping to see concise statements again and Ehab's X-OR won't be missed this time ig
 On Imakf → Codeforces Round #706 Editorial, 3 years ago 0 Same. I just got 6 TLE with correct algorithm just for that and lost the points for C.
 On Imakf → Codeforces Round #706 Editorial, 3 years ago +4 I got TLE in C just for taking inputs as double in my code. The same code when I just changed the input type from double to long long it got AC. Help!! Thanks in advance. Links to the TLE and AC code is given below and changes are also specified by comment.
 On awoo → Educational Codeforces Round 98 Editorial, 4 years ago 0 There is another nice approach to Problem D using combinatorics.
 On vovuh → Codeforces Round #674 (Div. 3) Editorial, 4 years ago 0 steinum we can write (∑pik=0(ai+k)×(pik)×2pi−k) this part as this (3pi−1(3ai+1)). Is there any formula for this line you wrote??
 On SleepyShashwat → Codeforces Round #663 (Div. 2), 4 years ago +3 Yes...But there is modular arithmetic..
 On SleepyShashwat → Codeforces Round #663 (Div. 2), 4 years ago +1 Problem C was really awesome and the statements were also quite perfect...
 On chokudai → AIsing Programming Contest 2020 Announcement, 4 years ago 0 If the string size 2e5 having all 1 in the string, then cnt =2e5. So after first mod operation X must become 0 to 2e5-2, X = the number of whose binary string is given. Let, it becomes X = 2e5-2 after first operation.Now for the second operation cnt must be less than 20 as log2(2e5-2)<20.Then we can check untill X becomes 0 as it will be a very few moves. And the first operation I tried to explain in my first comment....
 On chokudai → AIsing Programming Contest 2020 Announcement, 4 years ago +6 Look after the first modulo operation x will be between 0 to cnt-1, cnt = number of 1. Then the binary representation will have 0-20 digits as log2(N) < 20. Then it's easy.So we have to calculate the mod of first operation. Now the problem is X is huge. X can be written as X = sum of power of 2 from binary representation. And for every position in the binary string the number of 1 will be cnt+1 if S[i] = 0 or cnt-1 if S[i] = 1. So for this two we will calculate the module of X in O(n) operation.Let, after first operation X becomes a. Now for pos 0 to n-1 if S[pos] = 0 a = (X + pow(2, n-1-i))%(cnt+1) else a = (X - pow(2, n-1-i))%(cnt-1) This way we can handle the first operation. Another special case is cnt = 1, Then if S[pos] = 1, output will 0. Here is my Code
 On chokudai → AIsing Programming Contest 2020 Announcement, 4 years ago +2 You don't had to ig... Brute force would suffice..
 On chokudai → AtCoder Beginner Contest 169 Announcement, 4 years ago +1 Thanks man. That means 1e18 format is double type.
 On chokudai → AtCoder Beginner Contest 169 Announcement, 4 years ago +5 In B:For the statement: if(inp[i] <= 1e18/ans) I got WA. But when i wrote : if(inp[i] <= 1000000000000000000/ans) I got AC. Is there any differences between 1e18 and 1000000000000000000?? Otherwise what is the reason??
 0 Can we get all the elements of the maximum subarray by kadane's algorithm??