ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1100. Final Standings

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
Posted by nicushor 1 Jun 2005 21:55
:) interesting... good done! :)
Re: AC 0.3 Sec 972 KB
Posted by Cybernetics Team 2 Jun 2005 20:45
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
Posted by void off() 6 Jan 2006 20:40
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
Posted by Dulat_TKTL 28 Jan 2006 15:28
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
Posted by Michael Rybak (accepted@ukr.net) 8 Feb 2006 18:15
1. Replace 150000 with 150001
2. C++ solution doesn't get MLE even without hi-lo representation, simply use long.
void off() wrote 6 January 2006 20:40
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
Posted by void off() 10 Feb 2006 19:50
> 1. Replace 150000 with 150001
Thanks, it works! AC
Re:Your code is wrong!!!!..Memory limite exid
Posted by AOTL_EKREM 13 May 2006 17:01
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
Posted by fstilus_chiki 4 Sep 2015 20:12
You are good! Thank you! You are genius!               But my program work faster :-))




































But it doesn't work :-|