If a problem's input consists of lines with 2 integers and is not terminated by any special numbers, what should my termination condition look like?
I.e. Input:
1 2
5 3
6 2
4 1
I was using while (cin >> num1 >> num2), but when I submitted the problem I got "time limit exceeded".
I just wanted to find out if it's because how I handle the input, or if my program is just too slow...
Input Question
Moderator: Board moderators