Блог пользователя Freedom

Автор Freedom, история, 7 лет назад, По-английски

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!

Полный текст и комментарии »

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

Автор Freedom, 9 лет назад, По-английски

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

Полный текст и комментарии »

  • Проголосовать: нравится
  • -9
  • Проголосовать: не нравится