acmbucc's blog

By acmbucc, history, 6 years ago, In English

Hello Codeforces!

Can anybody please explain why this code is giving run-time error on codeforces? This solution is accepted in the actual OJ where the contest took place.

Here is the contest link- https://codeforces.me/gym/102141 Problem no is G.

Here is my code- https://ideone.com/xEqXuc

Could it be a reason that the testcases are not given as standard input output rather as a file? Although there seems to be no problem when using C++. So I can't be sure of what's going on here! Someone please shed some light here.

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

| Write comment?
»
6 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

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

»
6 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

People here in CF need to be held accountable for downvoting without stating the reason. This is saddening to see people not saying anything but downvoting.

»
6 years ago, hide # |
← Rev. 2  
Vote: I like it 0 Vote: I do not like it

I don't know exact reason of such behaviour, but all last java submits (at least on this problem) crashed with next result:

Java 8: Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create new native thread

Java 11: [0.025s][warning][os,thread] Failed to start thread — beginthreadex failed (ENOMEM) for attributes: stacksize: 65536k, flags: CREATE_SUSPENDED STACK_SIZE_PARAM_IS. Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

So it is not problem of your code, but some problem with running JVM for this problem or whole gym (i looked status of CF Archive — Java works there).

  • »
    »
    6 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    Thank you for confirming that this isn't happening because of my mistake. I appreciate this.

    Although I'd like to know the reason behind this. Anyone having knowledge about this please leave a comment below.