ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1100. Таблица результатов

AC 0.3 Sec 972 KB
Послано Bourne 10 апр 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
Послано nicushor 1 июн 2005 21:55
:) interesting... good done! :)
Re: AC 0.3 Sec 972 KB
Послано Cybernetics Team 2 июн 2005 20:45
just... brilliant!
Re: AC 0.3 Sec 972 KB
Послано acmkx 24 ноя 2005 13:13
MLE
IT is not AC program, it got MLE
Послано SSS 6 янв 2006 13:05
Maybe tests were changed since april...
Isnt it, Judges?
Re: IT is not AC program, it got MLE
Послано void off() 6 янв 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
Послано Dulat_TKTL 28 янв 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
Послано Grab 8 фев 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
Послано Michael Rybak (accepted@ukr.net) 8 фев 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() писал(a) 6 января 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
Послано void off() 10 фев 2006 19:50
> 1. Replace 150000 with 150001
Thanks, it works! AC
Re:Your code is wrong!!!!..Memory limite exid
Послано AOTL_EKREM 13 май 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
Послано fstilus_chiki 4 сен 2015 20:12
You are good! Thank you! You are genius!               But my program work faster :-))




































But it doesn't work :-|