yeah....but why......
#include<iostream>
#include<stdio.h>
using namespace std;
#include<cmath>
#include<iomanip>
#include<cstdio>
int main(){
int med1,med2,med3;
double area,s,a,b,c,x;
while(cin>>med1>>med2>>med3)
{
if((med1+med2)>med3 && (med1+med3)>med2 && (med2+med3)>med1)
{
s=(med1+med2+med3)*0.5;
x=sqrt(s*(s-med1)*(s-med2)*(s-med3));
area=(4.000*x)/3.000;
}
else
area=-1.000;
if(area>=0)
cout<<fixed<<setprecision( 3 ) << area << endl;
else
cout<<1.000;
}
return 0;
}
this one is also giving WA....but why????
10347 - Medians
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10347-WHY TLE???
Input:
0 3 3
AC Output
-1.000
0 3 3
AC Output
-1.000
Check input and AC output for thousands of problems on uDebug!
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10347-WHY TLE???
try reading the input as doubles instead of ints.
Check input and AC output for thousands of problems on uDebug!