SAFWAN.K's blog

By SAFWAN.K, history, 8 years ago, In English

Hello All problem H.Bridges :http://codeforces.net/gym/100712/attachments

my solution :

code : http://ideone.com/86zKZk

  1. run Tarjan algorithm store each bridge edges in map

  2. make new graph without bridges edges

  3. run DFS on graph and give each component Unique id

  4. make graph from component IDs then get Longest path

  5. if there is no bridges in graph then answer is 0

else the answer will be #ofbridges — longest path.

my solution getting MLE any hint to pass it ?

Thanks All.

UPD : Solved

solution : http://ideone.com/QIYU0x

Full text and comments »

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

By SAFWAN.K, history, 8 years ago, In English

Hi All

can anyone tell me why this two solution

gives me WA on UVA

this is problem : https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3977

first solution : http://ideone.com/WVbSQO

second solution : http://ideone.com/Kb3TmW

thanks all

Full text and comments »

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

By SAFWAN.K, history, 9 years ago, In English

Hi all how to take gcd between rational number

a/b,c/d

thank all

Full text and comments »

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

By SAFWAN.K, history, 9 years ago, In English

Hi all Is there a formula to find the sum of the following series

i<=j

i*j+(i-1)*(j-1)+...+(i-i)*(j-i)

thank you all

Full text and comments »

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