|
|
It's obvious that answer for first team is n - 1 How to get answer for second team. Of course total number of points do not exceed 3 * (n * (n - 1) / 2), because we played n * (n - 1) / 2 matches, and in every match summary points not exceed 3. Assume looser team got k points, that mean that total number of points >= k * n. But k * n can't be greater than 3 * n * (n - 1) / 2, so: k * n <= 3 * n * (n - 1) / 2, then k <= 3 * (n - 1) / 2. Answer is 3 * (n - 1) / 2. But how to prove that we can make such competition where k is the smallest value and we have (n - 1) values that are not less? Edited by author 08.06.2022 21:21 subj Good question. Unreal problem ..?? Yes...please help me 3>> 2 3 4>> 3 4 15>>14 21 Edited by author 07.10.2006 20:21 if all matches finish with draw, all teams must have n-1 points. If there are 3 teams answer is 2 2. Is it true?? if all matches finish with draw, all teams must have n-1 points. If there are 3 teams answer is 2 2. Is it true?? No correct Answer for 3 is 2 3 because if 1 win 2 if 2 win 3 if 3 win 1 they all have 3 points Osliki and T34 must get min and max simultaneously in one game? You must know score of Ural SU Osliki and Ural SU T34 team is not simultaneously in one game. For the first team. If they play all game with draw so the winner have n-1 scores. For the second team. The best scores is all team is win in n/2 games so the second team have (n-1)/2*3 scores but if n is even so it have one game for draw. for n is even = (n-1)/2*3 + 1 for n is odd = (n-1)/2*3 *sorry for bad english I have Ac(0.015) by diagonal sequantal placing nambers 1..N*N from max and min alternating 25 2 22 6 2 17 1 23 5 18 10 24 4 19 9 14 3 20 8 15 12 21 7 16 11 13 but clear mathamatic proof i don't now and this is most interesting. I will try find out such proof and if people will have interest will send this proof to forum. Without proof algotithm hasn't hard foundation. So, what is your algo, svr? After building your matrix, what are you doing? Thanks. Edited by author 17.10.2006 13:53 If we have optimal matrix to take answer is very simple problem. We use double loop, calculate sums A[i,j]+A[i-1,j] and A[i,j-1]+A[i,j] and renew record value searching max. First number is always : (n - 1). Second if n even => 3 * ((n - 2) / 2) + 1 If n odd => 3 * ((n - 1) / 2) Yes, I have also maden by this way. My program is in 7 lines(without var,begin,end - 3). But I don'y understand why it works in 0.015, except 0.001. I used only 1 read and if. strange isn't it? what is answer if n=8 when only one match with win&lose ,and other is draw answer should be 6 9 (6(1)+3)? Edited by author 24.02.2008 13:21 Edited by author 24.02.2008 13:21 Could someone please post the output for n=4 ? Cause the problem is not very specific. All matches could be draws and then... But it appears that's not possible. Why not? 3 3 or not? I don't think so. That's like asuming all matches are draws. I've tried this solution and it doesn't work. n==4 4 3 But we got WA 3 !! Please read the statement of the problem; you have to determine the MAXIMUM points of team2 and MINIMUM point of team 1. Edited by author 22.01.2008 14:53 Edited by author 22.01.2008 14:51 Can first number <> second number? I can't understand this task )= why output n-1 twice isn't right? if n=1, the answer should be 0 0 or not? Theoretically yes. But the problem statement says that the teams Osliki and T34 are participating. That's 2 teams. Ok. Thanks. Can they all play draw??? Can N be 1? Shouldn't be at least 2 teams? |
|
|