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

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

During Yesterday's EDU round, My solution to D was accepted and during system testing, it got TLE on test case 60. AC during contest : (https://codeforces.me/contest/1499/submission/110354551)

Now I submitted the same code multiple times after system testing is over, it is getting accepted. AC after system testing : https://codeforces.me/contest/1499/submission/110419651

So can anyone please tell what can be wrong in this scenario ?

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

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

Auto comment: topic has been updated by K_B_G (previous revision, new revision, compare).

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +9 Проголосовать: не нравится

same with my submissions....

»
6 лет назад, скрыть # |
← Rev. 5  
Проголосовать: нравится +26 Проголосовать: не нравится

Yes, I am having similar issues. All submissions are almost the same, you can compare. I think that the time limit to this problem is not optimal.

Submission 1 : https://codeforces.me/contest/1499/submission/110420452

Submission 2 : https://codeforces.me/contest/1499/submission/110390562

PS: the same code Submission : https://codeforces.me/contest/1499/submission/110420816 gives tle on test 39 now.

PS (yet again) : The SAME CODE is $$$Accepted$$$ now!!! Solution : https://codeforces.me/contest/1499/submission/110421153

Just change the way you write $$$2\times 10^7$$$, you will get tle. Solution : https://codeforces.me/contest/1499/submission/110422095

I have made some minor changes in each submission, so that Codeforces allows me to resubmit.

Admins please look into this issue, to either increase the time limit of this problem or take some other steps you might find suitable in this case.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +2 Проголосовать: не нравится

I don't know the specifics of why it happened, but I think it's something to do with a bit of random variance when running a program.

»
6 лет назад, скрыть # |
← Rev. 3  
Проголосовать: нравится +1 Проголосовать: не нравится

Yep, that happens, its just that every time you run a program it won't run in exactly the same time, there will always be minor fluctuations in runtime, for example this submission ran in around 1980 ms during the contest but I figured it would probably TLE out in system test so I optimised it a bit and submitted it again here which ran in around 1700ms during the contest, It barely passed on system test with 1996ms :/

So yeah, optimise as much as you can.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

same issue with me
tle:110372505
now passed: 110421066

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Same issue TLE: 110405479 AC: 110422060

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I think sometimes if the time limit is so strict they should rejudge the solutions by increasing the time limit by small amount

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +16 Проголосовать: не нравится

No need to rejudge, there was more than enough time for solutions to pass. It's your fault choosing to use unoptimal strategies. Simplest sieve passes all the tests in about ~1.3s. Take a look at icecuber's submission and you'll see what I'm talking about. It's the same as saying, please increase the time limit I used map instead of unordered_map.

»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
»
6 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

I was able to get the runtime close to 1000 ms with some precomputation with sieves. Can anyone help optimize this any further? I would be very grateful

https://codeforces.me/contest/1499/submission/110425912

»
6 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится +3 Проголосовать: не нравится

Same thing happened with me.see this 110380490 and this 110426784.MikeMirzayanov sir these submissions are same.still one passing after sys test and another giving tle during sys test