AC 0.3 Sec 972 KB Posted by Bourne 10 Apr 2005 13:49 program Bourne; var n,i,j,x:longint; a:array[0..150000] of smallint; b:array[0..150000] of longint; begin readln(n); for i:=1 to n do begin readln(b[i],a[i]); end; for x:=100 downto 0 do begin for i:=1 to n do if a[i]=x then writeln(b[i],' ',a[i]); end; end. No subject :) interesting... good done! :) Re: AC 0.3 Sec 972 KB just... brilliant! Re: AC 0.3 Sec 972 KB Posted by acmkx 24 Nov 2005 13:13 MLE IT is not AC program, it got MLE Posted by SSS 6 Jan 2006 13:05 Maybe tests were changed since april... Isnt it, Judges? Re: IT is not AC program, it got MLE Hmm... It gets MLE, really. Do they count memory on ALL tests, not on every test separately? Update: I've rewrited it, so it doesn't get MLE: #include <stdio.h> void main() { long n; unsigned char a[150000]; unsigned char hi[150000]; unsigned short lo[150000]; scanf("%ld",&n); for(long i=0;i<n;i++) { long bod; scanf("%ld%d",&bod,&a[i]); lo[i]=bod%65536; hi[i]=bod/65536; } for(int v=100;v>=0;v--) { for(int i=0;i<n;i++) if(a[i]==v) printf("%ld %d\n",hi[i]*65536+lo[i],a[i]); } } How can THIS get WA#11??? Edited by author 06.01.2006 21:12 Re: IT is not AC program, it got MLE I try so var a: array[0..100,0..150000]of longint; o,p,n,j,i : longint; begin readln(n); for i:=1 to n do begin readln(o,p); inc(a[p,0]); a[p,a[p,0]]:=o; end;
for i:= 100 downto 0 do begin for j:=1 to a[i,0] do writeln(a[i,j],' ',i); end; end. Re: IT is not AC program, it got MLE Posted by Grab 8 Feb 2006 17:11 try to concate K and ID into 1 longint variable (because 10000000=3 bytes, 1 extra) using shl, shr. I've goten AC and wish you the same Edited by author 08.02.2006 17:12 Edited by author 08.02.2006 17:12 Re: IT is not AC program, it got MLE 1. Replace 150000 with 150001 2. C++ solution doesn't get MLE even without hi-lo representation, simply use long. Hmm... It gets MLE, really. Do they count memory on ALL tests, not on every test separately? Update: I've rewrited it, so it doesn't get MLE: #include <stdio.h> void main() { long n; unsigned char a[150000]; unsigned char hi[150000]; unsigned short lo[150000]; scanf("%ld",&n); for(long i=0;i<n;i++) { long bod; scanf("%ld%d",&bod,&a[i]); lo[i]=bod%65536; hi[i]=bod/65536; } for(int v=100;v>=0;v--) { for(int i=0;i<n;i++) if(a[i]==v) printf("%ld %d\n",hi[i]*65536+lo[i],a[i]); } } How can THIS get WA#11??? Edited by author 06.01.2006 21:12 Re: IT is not AC program, it got MLE > 1. Replace 150000 with 150001 Thanks, it works! AC Re:Your code is wrong!!!!..Memory limite exid Re:Your code is wrong!!!!..Memory limite exid Edited by author 13.05.2006 17:02 Edited by author 13.05.2006 17:02 Re: AC 0.3 Sec 972 KB You are good! Thank you! You are genius! But my program work faster :-)) But it doesn't work :-| |