Here is the commented code for the solution.
no it is not accepted
My solution gets Runtime Error RE (SIGXFSZ). I found this error relates to printing more output lines. Here’s my solution. Could someone help?.
Thanks it worked for me too.
I can’t seem to figure out where my program is failing , tried it multiple of ways , used ‘\n’ instead of endl , gives correct output but it only passes 1 test case out of 3 . Can anyone help me ? : (
For base case n=1 your code gives WA. For n=1 you have to print:
1
1 1
But you are printing
1
1
Can someone help me with this one??
use \n instead of endl
I attempted it almost 10 times out of 10 times 8 times I got TLE. I know the logic behind this problem but always shows tle. What should I do in this case?
Plss help and support ![]()
![]()
Here’s my code-: CodeChef: Practical coding for everyone
To all who got TLE change cout<<endl ---- > cout<< ‘\n’
to get rid of this i make a macro
#define endl '\n'
so that wherever I use cout<<endl it will automatically replaced by cout<< ‘\n’
This problem is a classic example where size of output file has really hard boundary.
Basically SIGXFXZ error says “Exceeded max file size”
Every program when ran online has maximum output file size limit and blank spaces at the end of line increases the size.
Thus in your program if you find a way to avoid the blank space at end of file. your solution is excepted.
For Example
'3 1 2 3 ’ --> This will produce error (observe an extra space after second 3)
‘3 1 2 3’ --> This will be accepted
My code is passing 1 test case, but is giving WA in rest 2 cases. Can someone please look into this and share the reason.
Link to solution: CodeChef: Practical coding for everyone
PS: Python3
Try
1
1
Take the case of n=1:
1//2 results in 0
it must be 1
My solution is wrong, but it gives correct answer to all test cases.
Check this
- Calculate prime numbers and print them
- Print odd & even pair wise
Hi , I have used same method but getting TLE .
Please suggest improvement and reason for TLE
my loop is printing till 10948 only why so
i used the same logic but didn’t know it is called pigeonhole principle (i think i studied somewhere about this n forgot the name of principle,thanks for reminding) 