147  Dollars
Moderator: Board moderators
Re: why wa 147
It's accepted!
Last edited by tobat on Mon Apr 27, 2009 4:57 pm, edited 1 time in total.
Re: why wa 147
Can you read???Why wa
You made exactly the same mistake as almost everyone who posted here about their WA.
In short, to illustrate what it is, consider the following C/C++ boolean expressions:
Code: Select all
(int)(0.29 * 100) == 28
(int)(0.57 * 100) == 56
(int)(0.58 * 100) == 57
(int)(1.13 * 100) == 112
(int)(1.14 * 100) == 113
(int)(1.15 * 100) == 114
...
I suggest you read this article and this paper if you're curious why.
Re: why wa 147
Thank you very much!
I'm so careless!
now I get AC,I will be careful next.
Thanks again.
I'm so careless!
now I get AC,I will be careful next.
Thanks again.
Re: why wa 147
I didn't use any floating point in this problem. To read the input, just type:
It's so simple right?
Code: Select all
scanf("%d.%d", ¬e, &coin);
Re: 147 ,WA
Thanks to Jan vai for his sample cases
Last edited by Taman on Mon Nov 29, 2010 9:54 am, edited 1 time in total.
Re: 147 __int64 can't hold big results.Please help
@Newton: Hope that I am too late. You have solved the problem btt.
check these inputs :
0.11
0.12
0.01
And the title of this thread is wrong:)
long long is enough for this problem. @ least I got acc using %lld
check these inputs :
0.11
0.12
0.01
And the title of this thread is wrong:)
long long is enough for this problem. @ least I got acc using %lld
Re: 147 __int64 can't hold big results.Please help
i know why your code is WA :
your code
should :
only thats, n you will AC
your code
Code: Select all
printf("%6.2f%17llu\n", input, ways[ans]);
Code: Select all
printf("%6.2f%17llu\n", input[b]+eps[/b], ways[ans]);
Re: 147 ,WA
everybody please help me , i don't understand why it's wrong.....
Code: Select all
removed after AC
147 how to calculate coin change?
please any body help me.
give me an example of coin change made up.
Re: 147 __int64 can't hold big results.Please help
plz help me.. why wa..
i have check answer in uvatoolkit i think i have problem in output plz help me.
plz help im getting frustrated ....
Code: Select all
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
unsigned long long a[50000];
int main()
{
unsigned long long i,j;
int coin[]={5,10,20,50,100,200,500,1000,2000,5000,10000};
a[0]=1;
for(i=0;i<11;i++)
{
for(j=0;j<=30000;j++)
a[j+coin[i]]+=a[j];
}
double n;
while(1)
{
scanf("%lf",&n);
int m;
m=n*100;
if(m==0)
break;
printf("%6.2lf%17llu\n",n,a[m]);
}
}
plz help im getting frustrated ....

 Experienced poster
 Posts: 136
 Joined: Sat Nov 29, 2008 8:01 am
 Location: narayangong,bangladesh.
 Contact:
Re: 147 __int64 can't hold big results.Please help
Rather than doing
m= (n* 100), do this:
m = (int) (n * 100 + 0.5) to avoid floating point error.
m= (n* 100), do this:
m = (int) (n * 100 + 0.5) to avoid floating point error.
Life is more complicated than algorithm.
http://felixhalim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
http://felixhalim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
Re: 147 __int64 can't hold big results.Please help
For floating point error
Input two integer number
Example
Input two integer number
Example
Code: Select all
scanf("%d.%d",&d,&c);
amount = d*100 + c;
Re: 147 __int64 can't hold big results.Please help
Pls replace your code
Use integer not floating point
Use integer not floating point
Code: Select all
//scanf("%lf",&n);
scanf("%d.%d",&d,&c);
int m;
//m=n*100;
m = d*100+c;
if(m==0)
break;
//printf("%6.2lf%17llu\n",n,a[m]);
printf("%3d.%.2d%17llu\n",d,c,a[m]);
147  Dollars
Getting WA....plzz help...any testcase
Code: Select all
AC
Last edited by @ce on Tue Jan 01, 2013 10:31 am, edited 1 time in total.
@ce

 Guru
 Posts: 5947
 Joined: Thu Sep 01, 2011 9:09 am
 Location: San Jose, CA, USA
Re: 147  Dollars
Input:AC output:
Code: Select all
0.30
0.00
Code: Select all
0.30 6
Check input and AC output for thousands of problems on uDebug!