What compiler and OS are you using? What's the runtime error?
deceptikon
Challenge Accepted
3,457 posts since Jan 2012
Reputation Points: 822
Solved Threads: 474
Skill Endorsements: 57
Are you redirecting output to a file? SIGXFSZ is the signal raised when a file exceeds its size limitation.
deceptikon
Challenge Accepted
3,457 posts since Jan 2012
Reputation Points: 822
Solved Threads: 474
Skill Endorsements: 57
i am submitting there. the site is giving me time limit exceeded.
Okay, that's completely different. Obviously if you're writing to cout over 10,000 times then it's going to take a while. That's the problem, and the root cause is that your code is too slow due to the overhead of output.
my code complexity is O(1).
No, your code complexity is O(t).
so i tried it on ideone which gives me run time error.
It's not unreasonable to assume that Ideone has stringent limits on things like this, so I'm not surprised at all that you got a SIGXFSZ error. Use a real compiler on your local machine and that error will vanish.
deceptikon
Challenge Accepted
3,457 posts since Jan 2012
Reputation Points: 822
Solved Threads: 474
Skill Endorsements: 57