kvee119 wrote:*Just a few words of mine.
*Take #6 into account: Case-insentive Lex.
So when all have the same score and names are being considered, both
a B b
a b B
are correct. Dmytro already mentioned this.
It might be a cause for stable-sort's failure.
I got AC.
Thank you for answering
I already used case insensitive Lex : cmpnames() (called for the sort by names in step 6.1) uses strcasecmp, wich is case insenstive.
Or did you talk about another part of the code ?
Finally I got accepted I have bug in my function which do case-insensitive comparision....
Best reagrds
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)
Anyone bothers to explain how come this is the correct lexicographic order? I have solved this problem, so I know it is correct. But why? As far as I know shorter words should precede longer ones, as in case 'aa' and 'aaa', see the dictionary. But this order is weird to me. I think I wouldn't have solved this problem if I hadn't accidentally messed up the order with word lengths.
Ivor
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
Or then again it doesn't matter... I sent the other version with shorter words first and it was accepted too. Hmm... I wonder what it was I messed up in my first solution.
Anyway, sorry for keeping up a conversation with myself,
Ivor
There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here, it will instantly disappear and be replaced by something even more bizarre and inexplicable.
int main()
{
/* In the struct below, result[0] are the wins, result[1] are the ties, result[2] are the losses; goals[0] are the goals scored and goals[1] are the goals against. */
struct _team
{
char name[lim];
int points, result[3], games, goals[2];
}team[lim];
int n_tournaments, i, j, k, l, games, teams, score1, score2, aux;
char *team1, *team2, n_team[lim], word[wor], tournament[tour];
int main()
{
/* In the struct below, result[0] are the wins, result[1] are the ties, result[2] are the losses; goals[0] are the goals scored and goals[1] are the goals against. */
struct _team
{
char name[lim];
int points, result[3], games, goals[2];
}team[lim];
int n_tournaments, i, j, k, l, games, teams, score1, score2, aux;
char *team1, *team2, n_team[lim], word[wor], tournament[tour];