|
|
back to boardShow all messages Hide all messagesmaybe like this.... 5 1 2 3 4 5 or 1 1 or 5 1 1 1 1 1 Does each answer in your tests equal to 1 ? Edited by author 29.10.2006 14:28 yes. paste your code here.later delete. Re: OK Nurbek 29 Oct 2006 14:32 Edited by author 29.10.2006 14:50 Re: OK tester 29 Oct 2006 14:35 ohhhh.your solution incorrect.because 0 ≤ K ≤ 1000000000 check this test 4 10000000 10000001 10000001 100000002 answer:10000001 Re: OK Nurbek 29 Oct 2006 14:41 It gives error, shouldn't longint include all of this data ? Re: OK tester 29 Oct 2006 14:44 begin read(u); here>> 0 ≤ U ≤ 1000000000 and your array z:array[0..500000] of longint; inc(z[u]); end; use quicksort. Re: OK Nurbek 29 Oct 2006 14:49 Thanx a lot!!! I picked up a wrong solution way !!! the answer on test 4 10000000 10000001 10000001 100000002 is 100000002 Are you sure??? Read problem statement more carefuly. You should to output the majority element of this array[it's element which meeting in array more then n/2 times], so the majority element in your sample is 10000001. Test "5 1 2 3 4 5" is incorrect! hi Nurbek where do you study ? which ktl ? |
|
|