10686 - SQF Problems
Moderator: Board moderators
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
Realy don't know. Have over 30 WAs trying different things. In my view everything is dependent on what exactly is a word.
Is "fun&games" one word? or two?
And what about "little_creaper", or "better4you", "me@home", "seven,eleven"? Is "(something)" the same as "something".
Should we ignore capitalization at the beginning of a sentence? Does interpunction mark the end of a word? Or only if followed by a space or newline? And what exactly are the interpunction characters? Just '.', ',', '?', '!', and ';'? Or others too?
All questions and no answers...
Is "fun&games" one word? or two?
And what about "little_creaper", or "better4you", "me@home", "seven,eleven"? Is "(something)" the same as "something".
Should we ignore capitalization at the beginning of a sentence? Does interpunction mark the end of a word? Or only if followed by a space or newline? And what exactly are the interpunction characters? Just '.', ',', '?', '!', and ';'? Or others too?
All questions and no answers...
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
Well, that's exactly how I do it, so why WA???
[c]
/* CODE REMOVED, GOT AC */
[/c]
[c]
/* CODE REMOVED, GOT AC */
[/c]
Last edited by little joey on Mon Aug 09, 2004 9:50 am, edited 2 times in total.
I'm pretty certain that the input contains categories which has repeated occurances of one or more keywords. E.g. inputs like:
Where the output should be SQF Problem.
Code: Select all
1
Graph 3 2
edge
edge
edge
We need an edge!
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
Hm, then I don't know what your problem is.
I actually skip spaces when checking for empty lines (like the part of your isempty function that is commented out), but that should only be an issue if the input is flawed.
Don't remember what your code looked like earlier, but if the above is the fixed version, you still don't handle inputs like the one in my previous post correctly (so I'm guessing that it is the unfixed version above
).
I actually skip spaces when checking for empty lines (like the part of your isempty function that is commented out), but that should only be an issue if the input is flawed.
Don't remember what your code looked like earlier, but if the above is the fixed version, you still don't handle inputs like the one in my previous post correctly (so I'm guessing that it is the unfixed version above

-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
It was my old code.
I finaly got AC. My problem was not reading the input correctly for the special cases
This input made me see my errors:
Hope it helps someone...
I finaly got AC. My problem was not reading the input correctly for the special cases



This input made me see my errors:
Code: Select all
7
0
There are no categories in here.
3
NeverOne 0 1
NeverTwo 1 2
dummy
NeverThree 2 2
dummy
dummy
This is a text where the word dummy apears twice!
Because I've added a dummy line.
2
AlwaysOne 0 0
AlwaysTwo 1 0
xantippe
Xantippe has a capital 'X'!
1
NoText 1 1
text
1
NoTextToo 0 0
0
1
Always 0 0
The previous case had no categories and no text.
Thanks
I dont know what happened...But I think it was Per's suggestion that I remove empty spaces before I see end of line(ergo flawed input)
My prg got AC but I think there can be some change in judge for this.Atleast an enquiry?
My prg got AC but I think there can be some change in judge for this.Atleast an enquiry?
Just another brick in the wall...
I thought I'd try this problem too and I got AC but after a lot more trials then I had hoped for :-|
I especially had trouble with handling the newline-characters. Only after explicitly reading them each time I expected one (with gets() and NOT with scanf("\n")) I got it right.... So I think that there are lines with whitespace before the newline-character where this was not to be expected.
I especially had trouble with handling the newline-characters. Only after explicitly reading them each time I expected one (with gets() and NOT with scanf("\n")) I got it right.... So I think that there are lines with whitespace before the newline-character where this was not to be expected.
Excuse me, are those all SQF problems?little joey wrote:Code: Select all
7 0 There are no categories in here. 3 NeverOne 0 1 NeverTwo 1 2 dummy NeverThree 2 2 dummy dummy This is a text where the word dummy apears twice! Because I've added a dummy line. 2 AlwaysOne 0 0 AlwaysTwo 1 0 xantippe Xantippe has a capital 'X'! 1 NoText 1 1 text 1 NoTextToo 0 0 0 1 Always 0 0 The previous case had no categories and no text.

7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
-
- Guru
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
No. The output should be:
Code: Select all
SQF Problem.
SQF Problem.
AlwaysOne,AlwaysTwo
SQF Problem.
NoTextToo
SQF Problem.
Always
Why of course! Thanks very much~
(Actually I'm only interested of the 2nd case
)
(Actually I'm only interested of the 2nd case

7th Contest of Newbies
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org
Date: December 31st, 2011 (Saturday)
Time: 12:00 - 16:00 (UTC)
URL: http://uva.onlinejudge.org