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 1001. Reverse Root

WA#1
Posted by elf 21 Apr 2013 16:01
It works on my computer, but judgement result is Wrong Answer.

#include <stdio.h>
#include <math.h>

#define MAXSIZE 65536

int main()
{
  unsigned long int value = 0;
  int counter = -1;
  int i = 0;
  unsigned long int a[MAXSIZE];
  while (scanf("%lu", &value) != EOF)
  {
    a[++counter] = value;
  }
  for (i = counter; i > -1; i--)
  {
    printf("%.4f\n", sqrt((double)a[i]));
  }
  return 0;
}

Edited by author 21.04.2013 19:50
Re: WA#1
Posted by Hissain 5 May 2013 00:07
be confirmed that input limit is covered by your program
Re: WA#1
Posted by Declow 5 May 2013 00:38
Try to use unsigned long long, because 10^18>2^32
Re: WA#1
Posted by tianlan 9 May 2013 20:08
the array is too small,you can try global array to solve it ,but it should be large,at least

500000