LimuInc's blog

By LimuInc, history, 9 years ago, In English

i was tring to solve this problem So i`ve to calculate the minimum value of

N so that phi(n)=k

here what i was thinking in :

we could rewrite "k" such that

k=((a-1)*a^x)*((b-1)*b^y) ...... and so on where a,b are primes and x,y some values i`ve to find

then i`ve calculated all the primes where k%(p-1)==0 sorted in increasing order

then for each prime (p) brute force to get the power "a" such that "a" is the maximum value satisfy this relation

k%((p-1)*p^a)==0

then get the new k

k=k/((p-1)*p^a)

then Do the same using the next prime till the k reach 1

after reconstruct N using the primes and it`s values

but this solution dose not work . May some one help in how i could calculate the inverse eular ?!

Full text and comments »

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

By LimuInc, history, 9 years ago, In English

may someone explain what is the idea of this solution 3106087 , i know he hashing the string in some how and find

out the count of unique , what is the function of the xor operation used in hashing .

thanks in advance

Full text and comments »

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

By LimuInc, history, 9 years ago, In English

first of all sorry for my bad English .

i`m tring to solve this problem 448D - Про таблицу умножения , the editorial & accepted solutions solve it with Binary search

with left=0 and right boundary = n*m and they try and count number of numbers less than mid then take decision to move

left or right . i`m asking about that Not all the Number between 1 --> n*m are included in the answer space . for

example if n=m=2 --> 3 not a valid answer for any value of k .

i want to understand how binary search solution never touch these invalid values and produce the right answer ?!

thanks in advance .

Full text and comments »

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

By LimuInc, history, 9 years ago, In English

i ve tried to solve this problem 294C - Shaass and Lights but i can`t get the idea .... also after reading the editorial i cant understand

this formla 9!/(3!3!3!) . kindly if someone help me in understanding it .

thanks in advance and sorry for my bad English .
==================

Full text and comments »

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

By LimuInc, history, 9 years ago, In English

first of all , sorry for my bad English . im tring to sovle this problem http://codeforces.com/problemset/problem/225/C here is the idea ive : 1- get some of '#'s in each col 2- make 1D sum array of them (to be able to get number of #s in a given range) 3- then for for each consecutive range of cols with width >=x && <=y make them all of one type (#s or .s) and call the function with alternate type . here is my submission : http://codeforces.com/contest/225/submission/11485488 why getting time limit ? thanks in advance :)

Full text and comments »

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