|
|
input: 3 1 3 2 2 3 1 output: 1 3 2 Be careful if you use custom I/O. Input data may contain several spaces in a row Edited by author 23.08.2015 14:38 This test helped me get AC (i had access violation at test 12): 3 1 0 2 2 0 3 Good luck. is the answer 1 3 2 YES, your answer is correct also 1 2 3 correct too. this test help me, i hope it's help you too: input: 3 0 0 0 0 0 0 output: 1 2 3 or 1 3 2 or 2 1 3 or 2 3 1 or 3 1 2 or 3 2 1 sorry for my poor english. GOOD LUCK!!! If a girl does not like the boy who loves her, how do we resolve collisin. And if there is more than two boys and girls not liking anyone how do we resolve that. And if Boy A loves girl B Girl B loves boy C Boy C loves nobody how to proceed? Let Boy A go with Girl B, and Boy C go with any girl that loves Boy C or nobody To 1st post: that's not collision but ambiguous result. Any is ok. Edited by author 14.08.2008 22:26 Can anyone tell me what is wrong in answer to test: 4 0 4 1 2 0 0 3 0 ans: 3 4 1 2 and where is it written in problem description? in my opinion it is correct output according to problem statement. Am I wrong? Best Regards! please - answer also to tu219717@students.mimuw.edu.pl You can't pair 1st boy with the 3rd girl because neither of them like each other, and they are not both zero. Edited by author 14.08.2008 22:05 20 0 1 0 0 0 5 0 0 8 0 10 0 12 0 0 0 0 0 0 0 0 0 2 0 4 0 6 7 0 0 0 11 0 0 0 0 0 0 0 0 1 3 2 5 4 7 6 9 8 11 10 13 12 14 15 16 17 18 19 20 Why this code gives WA3?????? I don't know why? [code deleted] Edited by author 26.04.2008 22:14 Though the problem is very easy to solve, some tests can help, yeah? :) 3 3 0 0 0 2 0 3 2 1 // 3 0 0 0 0 0 0 1 2 3 // 3 1 2 3 2 3 1 1 2 3 // 3 0 1 2 1 2 3 1 2 3 // 4 1 2 3 0 0 2 4 0 1 2 3 4 // 5 2 1 0 0 4 0 3 2 0 0 2 3 1 5 4 Though the problem is very easy to solve, some tests can help, yeah? :) Thanks. I find more Bugs but I have WA#12. Help me! Condition N <= 1 000 000 was replaced with N <= 250 000. Tests were not changed. Test 4 4 0 2 3 1 2 3 1 0 4 2 3 1 ############## Test 5 4 0 4 1 2 0 0 3 0 1 4 3 2 Why does the result not 3412 (Test #5)?? boy#1 cannot go with girl#3, cause girl#3 is in love with boy#3 I think so (-: program ural1339; const maxk=1000000; var a,b:array[0..maxk]of longint; k,i,girl,t:longint; begin read(k); for i:=1 to k do read(a[i]); for i:=1 to k do read(b[i]); for i:=1 to k do b[a[i]]:=-b[a[i]]; for i:=1 to k do if b[i]>0 then begin girl:=i; repeat t:=a[b[girl]]; a[b[girl]]:=girl; girl:=t; b[girl]:=-b[girl]; until b[girl]=0; end; for i:=1 to k do b[a[i]]:=maxlongint; girl:=0; for i:=1 to k do begin if a[i]>0 then write(a[i]) else begin repeat inc(girl);until b[girl]<maxlongint; write(girl); end; if i<k then write(' ') else writeln; end; end. 3 2 3 0 1 2 3 your pro get crash 20 0 1 0 0 0 5 0 0 8 0 10 0 12 0 0 0 0 0 0 0 0 0 2 0 4 0 6 7 0 0 0 11 0 0 0 0 0 0 0 0 |
|
|