Moderator: Board moderators

UVA Problem ID :10773(Back to Intermediate Math)
#include<iostream>
#include<cmath>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
int t,i;
double d,u,v,td,t1,t2;
while(scanf("%d",&t)==1)
{
for(i=1;i<=t;i++)
{
scanf("%lf%lf%lf",&d,&v,&u);
if(u==0 || v>=u || v==0)
{
printf("Case %d: can't determine\n",i);
}
else
{
t1=(1.0*d)/(u*1.0);
t2=(1.0*d)/(sqrt((u*u)-(v*v))*1.0);
td=fabs(t2-t1);
printf("Case %d: %0.3lf\n",i,td );
}

}
}
return 0;
}
Last edited by Enayet Kabir on Tue Jun 05, 2012 4:09 am, edited 1 time in total.
Enayet Kabir
New poster

Posts: 7
Joined: Mon Jun 04, 2012 3:03 pm

What's the problem number?
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Problem Number : Uva id:10773(Back to Intermediate math)
Enayet Kabir
New poster

Posts: 7
Joined: Mon Jun 04, 2012 3:03 pm

Input:
Code: Select all
`38 5 61 2 31 5 638 5 61 2 31 5 6`

AC output:
Code: Select all
`Case 1: 1.079Case 2: 0.114Case 3: 0.135`
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

What is this sir? Already i have solved this problem . why u give my i/p and o/p ?
Enayet Kabir
New poster

Posts: 7
Joined: Mon Jun 04, 2012 3:03 pm

You asked why you were getting WA, and I gave a suggestion. Congrats on solving it.
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

brianfry713 wrote:What's the problem number?

i think every thing is right no problem is there.
New poster

Posts: 1
Joined: Wed Aug 08, 2012 2:13 pm

i ve checked so many critical input output . i am still getting WA ,,, plz anybody help me,,,, plz,,,, i am trying this for a long time ..... here's my code:
jimmgiht
mikhelee12
New poster

Posts: 1
Joined: Mon Sep 24, 2012 6:55 am

mikhelee12 wrote::o i ve checked so many critical input output . i am still getting WA ,,, plz anybody help me,,,, plz,,,, i am trying this for a long time ..... here's my code:

There's no code here.
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

here is my code

#include <iostream>

using namespace std;

int main()
{
int amp,fre,i,n,j,v,b;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>amp>>fre;
for(j=1;j<=fre;j++)
{

for(int k=1;k<=amp;k++)
{

for(int l=1;l<=k;l++)
cout<<k;
cout<<"\n";

}
for(v=amp-1;v>=1;v--)
{

for(b=1;b<=v;b++)
cout<<v;
cout<<"\n";
}
cout<<"\n";

}
}

return 0;
}
atul
New poster

Posts: 4
Joined: Thu Sep 27, 2012 4:21 pm

NOTE: There is a blank line after each separate waveform, excluding the last one.
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

I got AC...
Last edited by atul on Sat Sep 29, 2012 11:50 am, edited 1 time in total.
atul
New poster

Posts: 4
Joined: Thu Sep 27, 2012 4:21 pm

Now it is AC..
I forgor to print newline...
atul
New poster

Posts: 4
Joined: Thu Sep 27, 2012 4:21 pm

Problem no 1225 ,,,
I am getting WA.. plz help

this is my code

#include <stdio.h>
#include <stdlib.h>

int main()
{
int a[20],i,j,n,m,b,g,s;
scanf("%d",&n);
for(s=1;s<=n;s++)
{
for(i=0;i<20;i++)
{
a[i]=0;
}
scanf("%d",&m);
for(i=1;i<=m;i++)
{
g=i;
if(i<10)
{
a[i]=a[i]+1;
}
else
{
while(g!=0)
{
b=g%10;
g=g/10;
a[b]=a[b]+1;
}
}
}

for(j=0;j<=9;j++)
{
printf("%d",a[j]);
printf(" ");
}
if(s!=n)
printf("\n");
}
return 0;
}
atul
New poster

Posts: 4
Joined: Thu Sep 27, 2012 4:21 pm

Don't print a space at the end of a line.
brianfry713
Guru

Posts: 1755
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Next