Show all threads Hide all threads Show all messages Hide all messages |
Wa at 6 | LuoXi0209 | 1645. Ski Race | 12 Sep 2024 02:03 | 6 |
Wa at 6 LuoXi0209 28 Oct 2008 09:26 Who can help me? thanks. Give me some tests. i found you got AC finally. can you tell me what is the trick, thx. faint , the input is the number of the people who finished the contest. Re: Wa at 6 Olympic Bear (Nikolay Dubchuk) 4 Nov 2008 17:47 Yes, second line contains number of participant. So test example (3 5 1 4 2 6) means that participant #3 finished first, participant #5 finished second and so on. again I couldn't solve this problem because of bad understanding of problem..... I have had the same experience D: LaVuna Edited by author 12.09.2024 02:03 Edited by author 12.09.2024 02:03 |
Hint | Skeef79 | 1645. Ski Race | 9 Sep 2019 21:59 | 1 |
Hint Skeef79 9 Sep 2019 21:59 Count numbers bigger than a[i] from 0..i-1 ans smaller than a[i] from i+1..n-1 ans then try to build the answer :) |
Difficulty | Skeef79 | 1645. Ski Race | 9 Sep 2019 21:58 | 1 |
It is around 70 Edited by author 09.09.2019 22:01 |
I know what's the problem if you've got WA6 | MAK | 1645. Ski Race | 1 Nov 2017 12:39 | 1 |
My program had such mistake: it has printed results in the order in which athletes have finished the race, but the task is to print results in order in which athletes have started one. |
please help me what Wrong answer in test 6 JAVA | Axmadjon | 1645. Ski Race | 7 May 2014 10:22 | 1 |
import java.util.Scanner; public class _1645 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int i, j; long n, min, max; n = s.nextInt(); long[] a = new long[(int) n]; for (i = 0; i < n; i++) { a[i] = s.nextInt(); } for (i = 0; i < n; i++) { min = 1; max = n; for (j = 0; j < n; j++) { if (j > i & (a[j] < a[i])) { min++; } if (j < i & (a[j] > a[i])) { max--; } } System.out.println(min + " " + max); } } } |
i don't understand why? | Rustam | 1645. Ski Race | 18 Dec 2012 15:57 | 6 |
could you explain me test and answer? i can't understand how this situation may happen finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! Much more harger and so important is to prove the result. here is my solution, i don't know why it is not correct and i always wa at #6 lowest: min[i] = count of a[j] where{j>i and a[j]<a[i]} + 1 highest: max[i] = n - count of a[j] where{j<i and a[j]>a[i]} i need some help, thx. Edited by author 28.10.2008 08:15 finally i understood the problem. solution is much easier than it's problem. the problem's solution is very easy: to find min: min[i] = i -count of a[j] where{j<i and a[j]>a[i]} to find max: max[i] = n -count of a[j] where{j>i and a[j]>a[i]} good luck! I think there are some mistakes in your code. For other: Don't look at this code. Think yourself (As I) :) You are right,that anwer got Wa6 |
Also wa 6,what is the test | Pegasus | 1645. Ski Race | 18 Dec 2012 15:43 | 1 |
|
TO ADMIN: TEST 14 | Hikmat Ahmedov | 1645. Ski Race | 18 Mar 2012 15:52 | 3 |
I think you have a wrong check in test 14. In test 14, two or more sportsmen are passing the track in equal amount of time so that one of them is doing his best or worst rank. For example, in this test 31 2 24 14 23 21 18 4 26 30 25 13 11 17 9 29 22 15 7 3 19 5 8 12 10 28 27 6 31 16 20 1 --------We want to find the best rank for 1.------------ 1 achieves his best rank only if all previous sportsmen cross the finish line with 1 second difference. In this case 1 and 2 passes the track in equal amount of time. If 2 reaches the finish at time 1000 and 24 reaches the finish at time 999 and 14 reaches the finish at time 998 and so on … 1 reaches the finish at time 970 To find who the winner was we should subtract start time from finish time. So, 2 passed the tack in 970 seconds 24 passed the track in 309 seconds … 1 passed the track in 970 seconds As you can see, 1 and 2 are both passed the track in 970 seconds. The best rank of 1 is 30( or 31, 1 and 2 passed the track in equal time) And worst rank of 1 is 31(or 30, 1 and 2 passed the track in equal time) Here rank is ambiguous. My program gives this output for the test given above. 30 31 1 31 18 30 6 29 18 30 23 30 16 27 17 29 12 25 17 29 10 23 15 28 9 21 2 19 11 23 15 30 8 20 4 16 9 24 12 30 3 13 7 19 2 11 1 9 3 14 1 13 4 27 3 26 2 16 1 10 1 28 Calculations are summarized below: Finish Start Reached Passed order time finish track in 2 30 1000 970 24 690 999 309 14 390 998 608 23 660 997 337 21 600 996 396 18 510 995 485 4 90 994 904 26 750 993 243 30 870 992 122 25 720 991 271 13 360 990 630 11 300 989 689 17 480 988 508 9 240 987 747 29 840 986 146 22 630 985 355 15 420 984 564 7 180 983 803 3 60 982 922 19 540 981 441 5 120 980 860 8 210 979 769 12 330 978 648 10 270 977 707 28 810 976 166 27 780 975 195 6 150 974 824 31 900 973 73 16 450 972 522 20 570 971 401 1 0 970 970 Please, let me know, if I'm wrong Thanks, Edited by author 16.03.2012 16:54 Edited by author 16.03.2012 16:55 1) The permutation of numbers is the order in which the skiers finished. In your test the skier number 2 crossed the finish line earlier than the skier number 1. So it is impossible that number 1 finished in time 970 and number 2 finished in time 1000. 2) Skiers don't necessary pass the track in integer time. Thank you very much Sandro Now I have AC! For other people: Correct answer for test: 31 2 24 14 23 21 18 4 26 30 25 13 11 17 9 29 22 15 7 3 19 5 8 12 10 28 27 6 31 16 20 1 is: 31 31 1 30 18 30 6 29 18 30 23 30 16 27 17 29 12 25 17 29 10 23 15 28 9 21 2 19 11 23 15 30 8 20 4 16 9 24 12 30 3 13 7 19 2 11 1 9 3 14 1 13 4 27 3 26 2 16 1 10 1 28 |
Не получается первый тест | LILPIVO | 1645. Ski Race | 5 Dec 2011 22:06 | 1 |
кто знает какие там входные выходные данные ? |
Why WA#6? | vanla | 1645. Ski Race | 2 Nov 2011 13:48 | 1 |
|
What the test #6. Please help me. | ahmedov | 1645. Ski Race | 10 Aug 2011 05:15 | 3 |
Do you what the test #6. Please give me some tests. input: 6 4 3 6 5 1 2 output: 5 6 5 6 2 4 1 3 2 4 1 3 why is it true? for example, 4 -> 5 6, but he should have min = 4 |
Get me output for my input | Bogolyubskiy (MIET) | 1645. Ski Race | 17 Jan 2011 01:00 | 2 |
|
PLEASE HELP!!! My prog should be correct but WA#6... | BlackShark | 1645. Ski Race | 6 Mar 2009 16:34 | 1 |
What's wrong with this prog? var a:array[1..2000] of integer; i,j,n,max,min:integer; begin readln(n); for i:=1 to n do read(a[i]); for i:=1 to n do begin min:=1; max:=n; for j:=1 to n do begin if (j>i) and (a[j]<a[i]) then inc(min); if (j<i) and (a[j]>a[i]) then dec(max); end; writeln(min,' ',max); end; end. |
Problem | maciejonek | 1645. Ski Race | 18 Dec 2008 22:32 | 1 |
Problem maciejonek 18 Dec 2008 22:32 Edited by author 05.01.2009 03:08 |
what to output if... | Ildar Valiev | 1645. Ski Race | 25 Oct 2008 15:42 | 2 |
if First possible position = Last possible position. Two equal numbers or just one single number? |