marcose18's blog

By marcose18, history, 9 years ago, In English

Greetings Codeforces : - I was stuck on this Problem and it's editorial is also not clear enough. You can find its Editorial here.I wanted to ask one question that if we have modular equations like in this problem and if the mod is prime then is it true that they will be equal.I mean in this task C(i) = sum of its C(j)'s % mod and since mod is prime number does that mean they have to be equal(C(i) = sum of its C(j)'s).Of course for composite numbers it will definiately not hold because one simple case to fail it will be to consider a factor of mod and if n = mod/factor + 2 then it easily fails as 1 will be friend with all others and all others having 1 as his friend & and all of them having equal candies.Of course there will be only few n to fail this depending on the factors mod has but afterall there are cases.So if there is such a property for prime numbers I would like to know it (not taking into account case of 1).And yeah also please give some hints on how to solve this problem using Gaussian Elimination or any other method you like suitable.Thanks in advance.

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it

By marcose18, 10 years ago, In English

Hello Codeforces community ! Suppose I have declared a variable long cnt=0; //then I wish to do cnt+=Math.pow(2,59); //And again I do cnt+=Math.pow(2,3); Ideally now value should be cnt + 8 but value output by compiler is still cnt i.e. 8 is notincremented but if I parse that second statement somewhat like cnt+=(long)Math.pow(2,3); I am getting the desired answer .Would someone mind explaining it what'sthe difference here! Any help will be appreciated ! Thanx !.

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it

By marcose18, 10 years ago, In English

Can someone please explain how to solve the problem http://codeforces.net/problemset/problem/453/B I am unable to understand even the editorials here http://codeforces.net/blog/entry/13190 that how not taking the factors of given array a[i] will minimise the expression like in editorials and operation is done to remove the prime factors of a[i] using bitmask.Also I wasn;t able to understand the dp part.So a detailed explanation will be highly appreciated. Thanks in advance.

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it

By marcose18, 10 years ago, In English

I have been solving this problem http://codeforces.net/problemset/problem/26/D .I was unable to solve this on my own and looked for editorials here http://codeforces.net/blog/entry/610 but one thing i am unable to figure out is If suppose we have a favourable order i.e. order which will smoothly run so we can also permute the people having 10 euros and 20 euros amongst themselves in n! and m! ways.This will account for a different pattern .I am unable to guess why is that not taken into account and only different combinations are considered.

Full text and comments »

  • Vote: I like it
  • +3
  • Vote: I do not like it