11946 - Code Number

All about problems in Volume 119. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

bgcsaif
New poster
Posts: 38
Joined: Mon Sep 29, 2014 4:03 pm

Re: 11946 - Code Number

Post by bgcsaif » Wed Oct 01, 2014 7:21 am

It can be a reason. I guess I need to use while(gets(s)); instead of gets(s);. But if so it will take unlimited inputs for first case. It never ends to the last case. I tried uDebug. There's no way to end the inputs for each single cases I think. Am I wrong, sir?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11946 - Code Number

Post by brianfry713 » Wed Oct 01, 2014 11:18 pm

gets(s) will only return NULL/0 at the end of the input of the last test case. You can see if s is a blank string (s[0] == '\0') to detect the end of each test case except the last one.
Check input and AC output for thousands of problems on uDebug!

bgcsaif
New poster
Posts: 38
Joined: Mon Sep 29, 2014 4:03 pm

Re: 11946 - Code Number

Post by bgcsaif » Thu Oct 02, 2014 10:02 am

Thank You So much! I got AC. . . . I wonder it's hard to solve thy one problem. Then how it will be to solve all's problem. And it's hard to seek bug from other's code. You are great!
Can you help me saying the way to delete or edit post here?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 11946 - Code Number

Post by brianfry713 » Thu Oct 02, 2014 8:41 pm

If you are logged in you should see an edit box and an X above your posts.
Check input and AC output for thousands of problems on uDebug!

bgcsaif
New poster
Posts: 38
Joined: Mon Sep 29, 2014 4:03 pm

Re: 11946 - Code Number

Post by bgcsaif » Sat Oct 04, 2014 6:48 am

Thanks. . . I got it. . . I couldn't find it while using from my mobile browser. . . . . :)

Post Reply

Return to “Volume 119 (11900-11999)”