sky_light's blog

By sky_light, history, 7 years ago, In English

Hi everyone, I'm trying to solve a dynamic problem

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=24&problem=3637&mosmsg=Submission+received+with+ID+19929006

And this is my solution, it caught an runtime error and I dont know why. https://ideone.com/W9UHgh

Can anyone help me and explain why it caught runtime error and how to avoid runtime error ?

Thanks you.

Full text and comments »

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

By sky_light, history, 7 years ago, In English

The problem is you have an array size N with N (1<=N<=1000) , ai and reorder array to have the amount of a[i]<a[i+1] is maximum

example:

  • ~~~~~ Test 1: Input: 5 2 4 1 3 5 Output: 4


(now you sort it is 1 2 3 4 5)

Test 2: Input: 6 1 1 3 4 2 2 Output: 4

~~~~~

(now you sort it is 1 2 3 4 1 2)

Full text and comments »

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

By sky_light, history, 7 years ago, In English

Hi CFers, I just install ubuntu and I cannot know how to add default source code on it ?

Full text and comments »

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