Comments
On Iam17YearsOldFat Array, 3 years ago
0

it just feels good

what you are trying to convince in the last section of 2nd point is that for a fixed c array the lexicographically bigger b1 is always better compared to a smaller b2 (both having same sum and b1,b2 are sorted),now,what if c is exactly same as b2?

On psychobotATTENTION, 4 years ago
0

thats not true i just tried it

On psychobotATTENTION, 4 years ago
+1

just ignore him friends

On psychobotATTENTION, 4 years ago
+8

Auto comment: topic has been updated by psychobot (previous revision, new revision, compare).

when you find that ans is zero( v[i-1]/v[i] is not integer ) you can break,but if you don't the value of v[i-1]/v[i] keeps jumping ex 1 1000000000 1 1000000000 1 1000000000 1 1000000000... so so your actual complexity is now N*sqrt(m) instead of sqrt(m)

got you ORZzz!!!

can you explain more that how you got ans for merged string str1+str2 from answers of str1 and str2 and t1 t2 m1 m2 ,ok that answer of this string is |m| + max(0,t) but how to get answers of all substrings that pass from the concatenation point of str1 and str2

let v be the sorted vector of indices where a[i]!=b[i] (let size of v be vn) then the answer of the problem is f(0)

where, cost(i,j)=min(y,|v[i]-v[j]|*x)

f(vn-1)=y,f(cn-2)=cost(vn-1,vn-2)

f(i) = min(((vn-i)%2)*y + f(i+1),cost(i,i+1)+f(i+2))

One of the best C

my bad!!! I understood the problem incorrectly ;=(

I didn't got the first claim of problem E that strength required is max ai-bi.Suppose a={5,1,2,3,4} b={1,2,3,4,5} still if s=1 a can be converted to b by these operations swap(a1,a2) swap(a2,a3) swap(a3,a4) swap(a4,a5),,then how is the claim true??

If CF worked like that I could have been red...

why so tight constraint(a,b<2000000000) for d? that forced to think exactly like you which is not always possible;

Nope

l<=x<=r

A very well balanced contest,, Loved it..

On MonogonGlobal Round 18 Editorial, 5 years ago
0

look closely i have written [x%(2^(j+1))]-2^j which can be negative

On MangoosteGlobal Round 19 Editorial, 5 years ago
-15

He didn't participated :-{

On omhariUse of std::function in c++, 5 years ago
0

they didn't got uhh

(x+y)%2 == (x xor y)%2 so whatever you do doesn't matter at the beginning alice and bob have numbers with different parity so at the end also they will have numbers with different parity hence only one of these can be winner

1,1,2 have mean of 1.5

why would they want to make it more solvable you have to do this thing....

On HunterXDStrange message (Scam), 5 years ago
+8

I got this from devaneter_99

message

I still can't understand this..

On MonogonGlobal Round 18 Editorial, 5 years ago
0

count of numbers in [1,x] having jth bit set is floor(x/(2^(j+1))) + max(0,x%(2^(j+1))-2^j).

On MonogonGlobal Round 18 Editorial, 5 years ago
+1

we can calculate the number of set bits at jth position in [1,n] in O(log n)

C->D(1400->2100) shouldn't there be a problem of 1700 in between(considering div2)

You know who XD

+6

Happy diwali guys Let's finally enjoy for 2 days :)

On DISSARAY88DISSARAY88, 5 years ago
+1

why green?? aim for red :)

On nitorPresenting Tourist Facts, 5 years ago
+7

here are tourist's pro tips :)

+14

mathematics

where

every

math

math

Korney Korneevich sounded like gennady korotkevich to me :-)

actually when i wrote that comment i thought the wrong way but after thinking a lot i concluded that for m>=n there exists such an input for which solution is not possible ex: suppose n=m=6 consider the following 6 constraints {(1,2,6),(1,3,6),(1,4,6),(1,5,6),(1,6,2),(2,1,6)} here considering first 4 no node can be between 1 and 6 so u are forced to connect 1-6 if done this u cannot add 2 to either side as it will always violate the either of the last 2 constraints,,,,, may be there is a solution for some special cases for m>=n

however it should give wrong output format rather then TLE if so i would have done d too

violating the condition that 1<=aj<=n i also did same mistake though

can think of m<2*n

u only checked for indices which are "." but u should also check for "X" too a simple example is this XX XX your code will give YES for it but ans should be no as following will also produce same EN grid XX X.

oopssss got it

my solution to D is working in my device properly but when i submitted it showed TLE on permutation {1,2} anyone kindly help 132260554

I did with dp i can have ans if n goes till 1e8 its sometimes very interesting to know that the solution was very diffrent[submission:131209883]

he is saying that ((x^y)%mod)!=(((x^(y%mod))%mod))

they are same

[submission:https://codeforces.me/contest/1567/submission/127980698] O(n) solution for problem D

its okay if it's problem A

that scared me first

actually not full

On cip999Editorial of Global Round 15, 5 years ago
0

can u elaborate more??

yaa makes sense

if the king only oscillates in two squares then the possible positions will be 64-16=48 and if u are unlucky enough u can exhaust 130 moves

even if n==k u have to take whole input :-)

we cannot rely on random walks what if the king is oscillating back and fro in two squares and doing random walks yr queen doesn't give check I know that probability of this is less but is not 0 so this approach can fail once in a million

If input array have duplicates your m[a[i]] will be over written and hence some data is lost this will produce an error suppose that array is 2 2 2 2 then always a[i]=2 and m[2] will be over written 3 times and eventually will store the last value and previous will be lost

-18

XD

+31

my god they remembered the question of the contest which was 8 years ago :-O