SIGCONT error?

Hi Guys! I am trying to solve the very first question of the DSA learning series and got this error. Could anybody please ellaborate what is this error, why this code is producing this error at runtime and correct answer while submission??

#include <iostream>
using namespace std;

int main() {
	int a;
	while(true){
	    cin >> a;
	    if(a==42)
	        break;
	    cout << a << '\n';
	}
	return 0;
}

Consider the testcase

1

Could you please elaborate what is this error? I am getting this one in many problems. Why this only occurs at runtime as my program is correct at submission.

Are you trying to “Run” without Providing “Custom Input”?

5 Likes

if your output is very large… it gives this error. I read in some blog that this means that the online compiler has reached character printing limit. Different online ide has different limit. This error doesnt mean the code is wrong. The code is correct and if you print out the output in a text file you will probably get correct reasult / no error. I got this error once when i ran the code… but i submitted it and got AC in that question.

9 Likes

Yes!
Thanks bro :slight_smile:

Thanks @sageof6paths :slight_smile:

your welcome :+1:

bro, i does’nt understand this , can you pls explain in detail because i got the same error .So how can i submit my code and get ac in codechef ide

If your output has a large no of numbers (kind of running infinitely). Then this error comes.

thanks bro

Thankss bro it’s really very helpful

i faced similar issue today while solving one adaking problem in c++
i changed cin cout by scanf printf and used the c++17 compiler it worked for me

1 Like

Take long long int it will get resolved … :smiley:

Thanks @everule1. That solved my issue. I am new to codechef and I thought just by clicking the run button will evaluate our code against predefined testcases.

thank you!! the runtime error didn’t show up after giving custom input. and it was accepted 100%.