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

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

I have solved problems in online judges like uva/timus/live archive/lightoj where there is no time limit for a particular case but a limit for the whole data set. I want to know how it works in codeforces and sgu where we have time limit per test case. I need clarification for two scenarios

1) In judges like uva and in the acm icpcs, we can precalculate stuffs. Like we can generate prime numbers in advanced, calculate nCr for some n and r before working with individual cases and need not generate these stuffs later while working with each test case. But, for codeforces and sgu, this is useless right? As my code will be executed newly for each test case. So no point of precalculation right? Whatever I need, I will have to generate/calculate for every single test case??

2) The time limits in uva or similar site is usually around 1-3 secs. That's for the whole dataset. And in codeforces/sgu, we have 0.5 sec (around 1 sec) for each case. That means, my solution in codeforces/sgu for 0.5 sec time limit can have around 5*10^7 instructions as that will take around 0.5 secs. Isn't that less challenging compared to solving a problem with around 10^6 instructions in timus/uva/icpc style sites? Shall we approach a problem which has time limit of 3 sec in timus and time limit of 0.5 sec per test case in sgu in the same way both the sites?

I feel I am missing the whole idea behind this time limit per test case system. I know there is nothing as less challenging or whatsoever, but I just need to get clarified. Any DETAILED explanation would be really helpful.

Thanks in advance.

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

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