Comments

for(ll bit=0;bit<=32;bit++)

this tries to access bit[32] but you declare bitset<32>.. array indexes from 0-31,, bit[32] doesn't exist.. "Out of bounds"

yeah lol

I was able to think of correct solution for A (div. 2) in 5 minutes and it was too obvious.. I was like are the authors trying to troll.. then I went on looking for a proof and voila 20 minutes gone.. and what did I find out? my instinct was right.. I am so dumb

On N29Codeforces Round 1054 (Div. 3), 11 months ago
0

i see some people submitting all their solution at the last minute? why is that

thanks

you can do greedy solution.. the main thing that you have to observe is that looking for next white cells by brute force does not actually give TLE.. cause at some point next cell will be out of range of the existing set. at least i passed the pretest with it.. don't know what will happen in system testing

please tell me it won't unrated for this reason :'(

+11

i submitted B in python(pypy) compiler.. and passed 10 pretest.. and got TLE in 11the testcase during system testing..after contest i applied same logic same datastructures.. just used c++ and it passed.. so brutal. i am never using python in here again

not true..

how about max(a[i],b[i])<=min(a[i+1],b[i+1] this ensures that pair (a[i],b[i]) is good.. swapping and not swapping the pair both works for sorted sequence

import sys
input = lambda : sys.stdin.readline().rstrip()
iin = lambda : int(input())
sin = lambda : str(input())
miin = lambda : map(int,input().split())
msin = lambda : map(str,input().split())
liin = lambda : list(miin())
lsin = lambda : list(lsin())

def solveTestCase():
    n,m=miin()
    v=liin()
    v.sort(reverse=True)
    res=0
    for cake in v:
        if m>0:
            res+=(m*cake)
        m-=1
    print(res)

for _ in range(iin()):
    solveTestCase()

does this solution work.. if it does .. then why?

i came up with this solution when the contest was live.. but then a thought came into my mind.. what is happening to the remaining seconds when m>n .. i did not notice that my solution is already working for such testacase( case 1 from the given cases ).. so i did not submit.. cause i am a dumass ofcourse.. but yeah why does it work

thank god it was Unrated.. just solved one problem lol

0

I couldn't solve the problem.. I saw his comment and just explained it to him why it works.. in contest I was able to reach one observation that a + a * k makes all the number divisible by k+1 .. but for that we need to add k a times.. but a can be greater than k so that goes out of the constraint.. I was stuck there.. so yeah I just explained to him why it works.. sorry for the rant

0
x = a+k⋅(a mod(k+1)) is always divisible by k+1
by division rule a = q(k+1) + r , 0<=r<=k
and r = a mod k+1

so,
     x   = a + kr
         = q(k+1)  +r + kr 
         = q(k+1) + r(k+1)
         = (q+r) (k+1)

so x is always divisible by k+1... do this for every number.. every number becomes divisible by k+1

0

C was easier than B.. I wasted all my time on B did not even look at C.. so pathetic.. how can I avoid doing this in future? I mean can't just go through all the problems to determine which one should I solve..

should I read all the problems with same score then decide which one I want to solve first..

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
0

meaning the solution passes for pretests but fails at system testing?

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
0

i get what pretests are.. why are people calling them weak

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
0

what does weak pretests mean

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
+1

edu rating change should be right after this round.. but still no updates. . tsk tsk tsk

...

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
0

what does weak pretests mean

On 0doOCodeforces Round 939 (Div. 2), 2 years ago
0

where is the rating update -_-

look at the previous comment

if you read the blog for latest div 2 contest it states that "UPD: The rating changes for Educational Codeforces Round 164 will be applied after this round." That means the rating will be given after the div 2 right?

blogpost link

Is this unrated?

what would be the rating for problem E? just wondering