11056 - Formula 1
Moderator: Board moderators
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
11056 - Formula 1
It was really frustrating during the contest that the problem description didn't say the pilots names should be sorted case insensitively. I got planty of WA's for comparing them by builtin operator<(string, string), which is case sensitive.
Re: 11056: Formula 1
lexicografically - means case insensitive comparison. So you shouldn't assume that "compare lexicografically" means "compare by ASCII value"Martin Macko wrote:It was really frustrating during the contest that the problem description didn't say the pilots names should be sorted case insensitively. I got planty of WA's for comparing them by builtin operator<(string, string), which is case sensitive.
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
Re: 11056: Formula 1
I'm not a native english speaker, but I don't think that 'lexicografically' implies 'case insensitive' automaticly. IMHO 'lexicografical comparison' of two sequences of objects means comparing the objects one to one from the beginnings of the sequences until we find a pair of different objects on respective positions in the sequences or one of the sequences ends. Therefore 'lexicografical comparison' doesn't say anything about what kind of comparison we use to compare the contained objects.Leonid wrote:lexicografically - means case insensitive comparison. So you shouldn't assume that "compare lexicografically" means "compare by ASCII value"
-
- Experienced poster
- Posts: 111
- Joined: Mon Jan 09, 2006 6:19 pm
- Location: Tehran, Iran
- Contact:
i 've got 15 PE during the contest , and i don't understrand why this happens
could some one take a look at my code
could some one take a look at my code
Code: Select all
cut off after finding my silly mistake
Last edited by arsalan_mousavian on Sun Aug 06, 2006 2:08 am, edited 1 time in total.
In being unlucky I have the record.
-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
-
- Experienced poster
- Posts: 111
- Joined: Mon Jan 09, 2006 6:19 pm
- Location: Tehran, Iran
- Contact:
-
- Learning poster
- Posts: 91
- Joined: Tue May 31, 2005 2:01 pm
- Location: Russia
please, give me output for next test cases:
3
Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
4
Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
2
BadPilot : 59 min 59 sec 999 ms
ABadPilot : 59 min 59 sec 999 ms
5
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
5
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
team-1 : 2 min 12 sec 999 ms
team-2 : 0 min 55 sec 582 ms
team-3 : 1 min 03 sec 000 ms
5
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
team-1 : 2 min 12 sec 999 ms
team-2 : 0 min 55 sec 582 ms
team-3 : 1 min 03 sec 000 ms
10
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
10
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 23 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
M.Schumacher1 : 1 min 22 sec 172 ms
R.Schumacher1 : 1 min 23 sec 172 ms
Barrichello1 : 2 min 12 sec 999 ms
Senna1 : 0 min 55 sec 582 ms
Fangio1 : 1 min 03 sec 000 ms
10
M.Schumacher1 : 1 min 22 sec 172 ms
R.Schumacher1 : 1 min 24 sec 172 ms
Barrichello1 : 2 min 12 sec 999 ms
Senna1 : 0 min 55 sec 582 ms
Fangio1 : 1 min 03 sec 000 ms
M.Schumacher2 : 1 min 23 sec 172 ms
R.Schumacher2 : 1 min 25 sec 172 ms
Barrichello2 : 2 min 13 sec 999 ms
Senna2 : 0 min 56 sec 582 ms
Fangio2 : 1 min 13 sec 000 ms
10
M.Schumacher1 : 1 min 22 sec 172 ms
R.Schumacher1 : 1 min 24 sec 172 ms
Barrichello1 : 2 min 12 sec 999 ms
Senna1 : 0 min 55 sec 582 ms
Fangio1 : 1 min 03 sec 000 ms
M.Schumacher2 : 7 min 23 sec 172 ms
R.Schumacher2 : 6 min 25 sec 172 ms
Barrichello2 : 5 min 13 sec 999 ms
Senna2 : 9 min 56 sec 582 ms
Fangio2 : 8 min 13 sec 000 ms
10
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 24 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
M.Schumacher : 7 min 23 sec 172 ms
R.Schumacher : 6 min 25 sec 172 ms
Barrichello : 5 min 13 sec 999 ms
Senna : 9 min 56 sec 582 ms
Fangio : 8 min 13 sec 000 ms
10
M.Schumacher : 1 min 22 sec 172 ms
R.Schumacher : 1 min 24 sec 172 ms
Barrichello : 2 min 12 sec 999 ms
Senna : 0 min 55 sec 582 ms
Fangio : 1 min 03 sec 000 ms
M.Schumacher : 7 min 23 sec 172 ms
R.Schumacher : 6 min 25 sec 172 ms
Barrichello : 5 min 13 sec 999 ms
Senna : 9 min 56 sec 582 ms
Fangio : 8 min 13 sec 000 ms
Last edited by StatujaLeha on Sun Aug 06, 2006 10:33 am, edited 2 times in total.
-
- Experienced poster
- Posts: 136
- Joined: Fri Apr 15, 2005 3:47 pm
- Location: Singapore
- Contact:
My AC program gives :
Hope it helps...
But I think all input testcases for the name of the driver will be 1 word (not separated), so some of your inputs might not be valid...removed... see below...
Hope it helps...

Last edited by jan_holmes on Sun Aug 06, 2006 10:51 am, edited 2 times in total.
-
- Learning poster
- Posts: 91
- Joined: Tue May 31, 2005 2:01 pm
- Location: Russia
-
- Experienced poster
- Posts: 136
- Joined: Fri Apr 15, 2005 3:47 pm
- Location: Singapore
- Contact:
Here it is :
Row 1
Senna
Schumacher
Row 2
Barrichello
Row 1
Senna
Fangio
Row 2
Schumacher
Barrichello
Row 1
ABadPilot
BadPilot
Row 1
Senna
Fangio
Row 2
M.Schumacher
R.Schumacher
Row 3
Barrichello
Row 1
team-2
team-3
Row 2
M.Schumacher
R.Schumacher
Row 3
team-1
Row 1
team-2
team-3
Row 2
M.Schumacher
R.Schumacher
Row 3
team-1
Row 1
Senna
Senna
Row 2
Fangio
Fangio
Row 3
M.Schumacher
M.Schumacher
Row 4
R.Schumacher
R.Schumacher
Row 5
Barrichello
Barrichello
Row 1
Senna
Senna1
Row 2
Fangio
Fangio1
Row 3
M.Schumacher
M.Schumacher1
Row 4
R.Schumacher
R.Schumacher1
Row 5
Barrichello
Barrichello1
Row 1
Senna1
Senna2
Row 2
Fangio1
Fangio2
Row 3
M.Schumacher1
M.Schumacher2
Row 4
R.Schumacher1
R.Schumacher2
Row 5
Barrichello1
Barrichello2
Row 1
Senna1
Fangio1
Row 2
M.Schumacher1
R.Schumacher1
Row 3
Barrichello1
Barrichello2
Row 4
R.Schumacher2
M.Schumacher2
Row 5
Fangio2
Senna2
Row 1
Senna
Fangio
Row 2
M.Schumacher
R.Schumacher
Row 3
Barrichello
Barrichello
Row 4
R.Schumacher
M.Schumacher
Row 5
Fangio
Senna
Row 1
Senna
Fangio
Row 2
M.Schumacher
R.Schumacher
Row 3
Barrichello
Barrichello
Row 4
R.Schumacher
M.Schumacher
Row 5
Fangio
Senna
-
- Learning poster
- Posts: 91
- Joined: Tue May 31, 2005 2:01 pm
- Location: Russia
Re: 11056: Formula 1
Exactly - THE objects. And the objects are stringsMartin Macko wrote:IMHO 'lexicografical comparison' of two sequences of objects means comparing the objects one to one from the beginnings of the sequences until we find a pair of different objects on respective positions in the sequences or one of the sequences ends. Therefore 'lexicografical comparison' doesn't say anything about what kind of comparison we use to compare the contained objects.

-
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
Re: 11056: Formula 1
No, in this case "the objects" are chars. Strings are sequences of "the objects", i.e. the chars.Leonid wrote:Exactly - THE objects. And the objects are strings

Re: 11056: Formula 1
yeah..and each char is composed of some dots on your monitor, while each dot is a set of a molecules, and each molecule is then divided into atoms and each atom is known to be a composite structure of quarks...can you go any further?Martin Macko wrote:No, in this case "the objects" are chars. Strings are sequences of "the objects", i.e. the chars.Leonid wrote:Exactly - THE objects. And the objects are strings

So let's just sort quarks lexicografically - isn't it gonna be fun?
