Freedom's blog

By Freedom, history, 7 years ago, In English

Hi.

I've submitted Problem C Round #395 (Div. 2). Why when I change these line

u=nodeColor.get(i);
v=nodeColor.get(a.get(i).get(j));
if (u!=v)

>>Full code

become

if ((Integer)nodeColor.get(i)!=(Integer)nodeColor.get(a.get(i).get(j)))

>>Full code

it get wrong answer?

Thanks!

Full text and comments »

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

By Freedom, 9 years ago, In English

I try to solve this problem 459C - Pashmak and Buses

It has Time limit exceeded on test 9

I printed the result to screen, it took nearly 25s:

But when I print to a file, run time is 94 ms:

Can you explain the different between two methods?

Thanks.

P/s: same code

9203418

Full text and comments »

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