|
0
In Problem B , we can just check: ((x&y) == (y&z) && (x&y) == (z&x)) ? "YES" :"NO" |
|
0
Problem C, Solution 2: Instead of trying 2 max degree nodes, we can choose the node having maximum depth amount all nodes having the max degree count. This is always work as the size of one connected component will be very much larger than other. And it leaves us a choice to choose 2nd node with more degrees. |
|
0
worsh case total # of operations your code doing: O(m*m*4logm) which will lead to TLE. m=5000. |
|
0
Another approach for Problem D: https://mirror.codeforces.com/contest/2025/submission/294067890 Hints: |
|
0
As you mentioned in the solution, all of the problems you mentioned with JJava can be bypassed effortlessly. Don't motivate people to leave Java. C++ also has issues like initializing randomly for primitive data type arrays. Java uses default values for them (0 for int[] and false for boolean[]). Also, Java does not provide Segmentation fault, which I like about Java. |
|
0
For 5, you can use Dequeue also. It has the same complexity as of ArrayList. |
|
0
My simple greedy approach for G using degree and dfs: https://mirror.codeforces.com/contest/1833/submission/206667701 |
|
0
The value of k can be -1, so initializing answer with -1 is wrong. |
|
+3
Dont use decimal calculations here, it has precision error. A simple approach is to find the largest k smaller than b and smallest k larger than b and check for the condition (b-k)^2 <4ac. |
|
0
I am getting WA in TC 4, I don't know why? Can somebody help me? Solution:https://mirror.codeforces.com/contest/1810/submission/200348409 |
|
On
Ormlis →
Codeforces Round #857 (Div.1, Div.2, based on Moscow Open Olympiad in Informatics, rated), 3 years ago
0
Div2-D had a very weak pretest. I got a WA in actual testing. It was : Which cost me +ve delta. |
|
0
How come the tutorial solution for problem F gives TLE ? https://mirror.codeforces.com/contest/1790/submission/194017127 |
|
0
Can somebody elaborate more on why this is happening? I mean at-most, we are calculating 2n states, why TLE then? |
|
+4
|
|
0
Can somebody help me out with Problem D : Link My approach is ans = max( min(2 * mn , min(a[i],a[i+1]))) , where mn is the minimum value of a. |
|
0
Well theoretically it should not pass as the # of operations: O(5000*5000*13) = 3.25 * 10^8. And we can process 10^8 operations in 1 sec. |
|
0
I did Problem C in O(n^2 logn) using binary search, got TLE. But the editorial says it will pass. How is this possible? My solution link : https://mirror.codeforces.com/contest/1678/submission/156353215 |
|
0
In the editorial of D, para 3, it is written, "It's easy to see that we should choose a character from the leftmost such block since that block is the earliest to be deleted (and if we want to make the same action later, we might be unable to do it).". My doubt is why is it optimal to delete from left only? Why does it matter which block we delete? |
|
0
Got a WA on TC2 for Problem C, not sure why. https://mirror.codeforces.com/contest/1608/submission/138834566 Can somebody tell me what is going wrong in my code or provide any counter case. Thanks |
|
-9
Problem C was a mess |
|
0
(1ll << cnt0) * (ll)cnt1 =( 2^(cnt0) ) * cnt1, where cnt0 = # of 0's and cnt = # of 1's in the array a. |
|
0
I am getting TLE for Problem E but I think my solution is O(nk), k = sqrt(n). Not sure why. could anybody please help me with this. Solution link : https://mirror.codeforces.com/contest/1582/submission/133125904. Although I am looping for j=1 to k and then calling memo(), but according to me, the total dp state calculation time is O(nk) only. |
|
0
You haven't applied modular operation. See my solution : https://mirror.codeforces.com/contest/628/submission/119295777 |
|
0
Auto comment: topic has been updated by ND_ (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by ND_ (previous revision, new revision, compare). |
|
0
Auto comment: topic has been updated by ND_ (previous revision, new revision, compare). |
|
Is any editorial available for these problems? If yes please paste the link here. Sorry for Spamming. |
|
0
Yes got AC. Thanx. But why my code gave TLE even changing after vector to vi |
|
0
I tried it and got TLE again:https://cses.fi/paste/04b6ac464bf1ec0b228547/ |
|
0
Coin Change 2 give TLE with O(n*target) time complexity solution link: https://cses.fi/paste/c0e3ad19fd184ec3227a11/ |
|
0
Easy and Detailed solution for Problem D : https://mirror.codeforces.com/gym/328681/submission/116502457 |