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

Обсуждение задачи 1001. Обратный корень

My program crashed and I don't understand 64 bit thing.
Послано Avijit Sarker 16 июл 2009 19:51
Hello.
The 1001 problem is the third problem I attempted in this site and I am new here. I am not familiar with 64-bit compiler system. The code written by me resulted in a crash, so I need some help.
I wrote the code as follows:
#include<stdio.h>
#include<math.h>
int main()
{
    unsigned long long a[32768];
    long i=0;
    while(scanf("%I64u",&a[i])==1) i++;
    for(i=i-1;i>=0;i--)
       printf("%.4lf\n", sqrt(a[i]));
    return 0;
}

I do know there are some fatal faults....but I really need help.
Thanks.
Re: My program crashed and I don't understand 64 bit thing.
Послано Sergey Lazarev (MSU Tashkent) 16 июл 2009 22:50
"A size of the input stream does not exceed 256 KB".
You have got crash because quantity of numbers can be greater than 32768.
Re: My program crashed and I don't understand 64 bit thing.
Послано Avijit Sarker 30 авг 2009 19:21
Then how can I determine the quantity? If the stream consists of 1 byte characters, and the integers are assumed to be 4 bytes, I need 256*1024/4=65536 membered array, right?
My program gives WA..it look ok..please help new to Timus :)
Послано rizwanhudda 23 сен 2009 16:39
#include<stdio.h>
#include<math.h>
#include<stdlib.h>

double    d[200000];

int main(){
long long l;
int i=0;
while( scanf("%lld",&l) != EOF )
d[i++]=sqrt(l);
for(i-=1;i>=0;i--)
    printf("%.4lf\n",d[i]);
return 0;
}

Please help getting WA