You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using this template and I was trying to solve this https://open.kattis.com/problems/countingstars.
The problem is that it is expected that the input will end at EOF. Can it be done solely with the code in the template? Or do I have to make a new method to detect (e.g, like Scanner's .hasNext())?
I apologize if this is something trivial. I am new to java.
Edit: Also any tips on how to practice/in what sequence to do topics to be able to solve more difficult problems?
The text was updated successfully, but these errors were encountered:
Hi @leimath,
I am glad that this repository is helping you.
There is a workaround that I use when input is supposed to be EOF terminated.
I used an infinite while loop which breaks when EOF is reached. But beware it is not advised to use infinite loops in your codes because it might have side-effects.
Here is the code snippet for taking EOF terminated input for the problem you mentioned in the issue.
Regarding your another query, its been a while that I have stopped doing CP so I might be unaware what people follow nowadays. During my time I used to follow CSES problemset for learning and live contests for practicing
I am using this template and I was trying to solve this https://open.kattis.com/problems/countingstars.
The problem is that it is expected that the input will end at EOF. Can it be done solely with the code in the template? Or do I have to make a new method to detect (e.g, like
Scanner
's.hasNext()
)?I apologize if this is something trivial. I am new to java.
Edit: Also any tips on how to practice/in what sequence to do topics to be able to solve more difficult problems?
The text was updated successfully, but these errors were encountered: