EgorKulikov / idea-chelper

Automatically exported from code.google.com/p/idea-chelper
112 stars 59 forks source link

Does not take first input form Hacker-Earth #51

Closed prash-kr-meena closed 6 years ago

prash-kr-meena commented 6 years ago

while parsing the question (i have tried it only during the contest) it does parse correctly, the input on the website matches with the input that c-helper input file (or inputs).

The problem occurs when in the solve function, i try to take the input (eg. int test_case = in.nextInt()..) then what happens is it skips over the first input in the file and picks the second one.. (which cause a lot of issues in my code) eg. if the c-helper parsed the input : 3 1 2 3

then int t= in.nextInt() ; ------> t = 1 , <skiped over 3>

I am using the FastIO class, of Petr/Egor here is the code: for that

InputReader code link 🔢

OutputWriter code link 🔢

jmerle commented 6 years ago

The issue has to do with the test type. If you switch the test type from the default 'Number of tests known' to 'Single test', it works flawlessly.

Screenshot

Or, shameless self-promotion, use my extension and it will automatically default to 'Single test', and it also supports parsing all problems in a contest at once, aswell as parsing a problem from the CodeArena.

prash-kr-meena commented 6 years ago

Thank you very much, the newer version is more awesome

On 20 Feb 2018 2:28 am, "Jasper van Merle" notifications@github.com wrote:

The issue has to do with the test type. If you switch the test type from the default 'Number of tests known' to 'Single test', it works flawlessly.

[image: Screenshot] https://camo.githubusercontent.com/db117e093202a5724cf584e56c3b01f4435e4624/68747470733a2f2f692e696d6775722e636f6d2f645353736558612e706e67

Or, shameless self-promotion, use my extension https://github.com/jmerle/chelper-companion and it will automatically default to 'Single test', and it also supports parsing all problems in a contest at once, aswell as parsing a problem from the CodeArena.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/EgorKulikov/idea-chelper/issues/51#issuecomment-366801242, or mute the thread https://github.com/notifications/unsubscribe-auth/AXIZffXpO5eckGWcUVXBYsvsisfAj7flks5tWeCDgaJpZM4R2GfS .