|
|
back to boardThis question looks easy. but i got WA, Help! Posted by abc 11 Jan 2003 06:47 My algo is as follows: 1.for any contestant i: 2. if(there is a contestant j whose three speeds all equal to i ) 3. then i and j are both sure losers; 4. else if(the three speeds of j are no less than i) 5. then i is a sure loser; 6. else if(the three speeds of j are no more than i) 7. then j is a sure loser; 8.for any contestant i: 9. if(i is a sure loser) writeln(No); 10. else writeln(Yes); Of course no :) (-) > My algo is as follows: > 1.for any contestant i: > 2. if(there is a contestant j whose three speeds all equal to i ) > 3. then i and j are both sure losers; > 4. else if(the three speeds of j are no less than i) > 5. then i is a sure loser; > 6. else if(the three speeds of j are no more than i) > 7. then j is a sure loser; > 8.for any contestant i: > 9. if(i is a sure loser) writeln(No); > 10. else writeln(Yes); > What about this test? 4 10000 10000 1 10000 1 10000 1 10000 10000 2 2 2 the fourth contestant is not a "sure loser" but always lose... |
|
|