handling time limit on judge (I'm newbie)

Write here if you have problems with your C++ source code

Moderator: Board moderators

handling time limit on judge (I'm newbie)

Postby Thanks 4 Alice » Fri May 11, 2007 6:36 am

solving #11151 problem...

I completed source code
found none of any faulty in my view
using only stdin(cin.getline), stdout(cout)...

like this...

while(true) {
- type input - (cin.getline)
- processing input - (algorithm for #11151)
- print output - (cout)
}

online judge system only gives me "Time Limit" msg repeatedly
like... 10.035 secs (I know the limit is 10 secs)

I think this is not a time limit exceed problem.
Maybe I need to modify "while ~ code" for this problem

anyone help me to handle this time limit?...

have a lucky day !
Thanks 4 Alice
New poster
 
Posts: 1
Joined: Fri May 11, 2007 6:25 am

Re: handling time limit on judge (I'm newbie)

Postby lnr » Mon Oct 06, 2008 4:23 pm

To Thanks 4 Alice
Your code:

while(true) {
type input - (cin.getline)
processing input - (algorithm for #11151)
print output - (cout)
}
May be you are not checking the end of file.
You are taking input on and on and on..................................................
User avatar
lnr
Experienced poster
 
Posts: 134
Joined: Sat Jun 30, 2007 2:52 pm
Location: (DU,CSE)Dhaka,Bangladesh


Return to C++

Who is online

Users browsing this forum: No registered users and 1 guest