SAFWAN.K's blog

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

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

»
8 years ago, # |
  Vote: I like it +1 Vote: I do not like it

why down votes ????

»
8 years ago, # |
  Vote: I like it 0 Vote: I do not like it

It's quite time consuming to read someone else's code... I suggest you code some brute force solution, generate many small test cases and compare the outputs.