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 1306. Sequence Median

PLEASE!!!!! HELP ME!!!!!!WHY WA#5?HERE IS MY CODE!!!!!!!!
Posted by CHIDEMYAN SERGEY 30 Mar 2007 20:22
#include<stdio.h>
#include<algorithm>
using namespace::std;
int main()
{int n,i;
scanf("%d", &n);
    float *a=new float[n];
    for(i=1;i<=n;i++)
        scanf("%f" ,&a[i]);
sort(a,a+(n+1));
if(n%2!=0)
printf("%.1f",(a[(n+1)/2]));
else
printf("%.1f" ,(a[n/2]+a[(n/2)+1])/2);
return 0;
}

You cannot store exact value of number in range (1;2^32-1) in 32-bit type float (-)
Posted by Orlangur [KievNU] 1 Apr 2007 17:32
Re: You cannot store exact value of number in range (1;2^32-1) in 32-bit type float (-)
Posted by CHIDEMYAN SERGEY 2 Apr 2007 00:15
THANK!I'LL THINK ABOUT IT!