10450 - World Cup Noise

All about problems in Volume 104. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

abid_iut
Learning poster
Posts: 82
Joined: Wed Jul 16, 2008 7:34 am

Re: 10450 - World Cup Noise

Post by abid_iut » Tue Dec 23, 2008 9:17 pm

why WA I have all the input(I think)
is there any more problem?
please help :(
here is the code:

Code: Select all

Removed after AC
Last edited by abid_iut on Wed Dec 24, 2008 9:36 pm, edited 1 time in total.
i love to wait... wait for better... and better will come...
http://akanoi.webs.com/

Articuno
Learning poster
Posts: 78
Joined: Sun Nov 30, 2008 5:00 pm
Location: IUT-OIC, Dhaka, Bangladesh

Re: 10450 - World Cup Noise

Post by Articuno » Wed Dec 24, 2008 11:40 am

Print a newline after each block of output.
May be tomorrow is a better day............ :)

abid_iut
Learning poster
Posts: 82
Joined: Wed Jul 16, 2008 7:34 am

Re: 10450 - World Cup Noise

Post by abid_iut » Wed Dec 24, 2008 7:46 pm

Thanks Articuno
Got AC :)
i love to wait... wait for better... and better will come...
http://akanoi.webs.com/

Asma_ju
New poster
Posts: 4
Joined: Sat Jun 11, 2011 9:20 am

Re:

Post by Asma_ju » Thu Jun 16, 2011 9:36 am

worldguy wrote:I tried to solve this problem using the long long type but failed. Well, when I shifted long long type to double type, I got it accepted. I'm wondering, why long long type gives out the incorrect answers?
I used long long and got ACC

Hasselli
New poster
Posts: 22
Joined: Mon Apr 16, 2012 8:08 pm
Contact:

Re: 10450 - World Cup Noise

Post by Hasselli » Sun May 13, 2012 8:09 pm

Code: Select all

#include <iostream>
#include <cmath>

using namespace std;

long long fib(int n){
        return 0.447213595 * pow(1.61803399, (double)n) - 0.447213595 * pow(-0.618033989, (double)n);
}

int main(){
	int t;
	cin >> t;
	for (int tt = 1; tt <= t; tt++){
		int n;
		cin >> n;
		cout << "Scenario #" << tt << ":" << endl << fib(n + 2) << endl << endl;
	}
}
Why WA?

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

Re: 10450 - World Cup Noise

Post by brianfry713 » Mon May 14, 2012 11:23 pm

Your formula doesn't work for large n.
Check input and AC output for thousands of problems on uDebug!

alimbubt
New poster
Posts: 39
Joined: Tue Aug 07, 2012 10:40 pm
Location: BUBT,Dhaka, Bangladesh
Contact:

Re: 10450 - World Cup Noise

Post by alimbubt » Fri Mar 15, 2013 6:17 pm

Input:

Code: Select all

10
5
7
8
9
13
15
22
26
31
33
Output:

Code: Select all

Scenario #1:
13

Scenario #2:
34

Scenario #3:
55

Scenario #4:
89

Scenario #5:
610

Scenario #6:
1597

Scenario #7:
46368

Scenario #8:
317811

Scenario #9:
3524578

Scenario #10:
9227465
Give me six hours to chop down a tree and I will spend the first four sharpening the axe...(BUBT ILLUSION)
http://uhunt.felix-halim.net/id/155497
http://onlyprogramming.wordpress.com/

User avatar
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: 10450 - World Cup Noise

Post by uDebug » Wed Mar 12, 2014 1:17 pm

Replying to follow the thread.
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.

Zyaad Jaunnoo
Experienced poster
Posts: 122
Joined: Tue Apr 16, 2002 10:07 am

Re: 10450 - World Cup Noise

Post by Zyaad Jaunnoo » Fri Nov 14, 2014 7:49 pm

Removed comments
Last edited by Zyaad Jaunnoo on Tue Nov 25, 2014 7:38 pm, edited 2 times in total.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10450 - World Cup Noise

Post by lighted » Fri Nov 14, 2014 8:34 pm

RE means Runtime Error, not PE (Presentation Error).
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

10450 - World Cup Noise, why WA??????

Post by NAbdulla » Thu Dec 25, 2014 11:09 am

removed after accepted
Last edited by NAbdulla on Fri Dec 26, 2014 12:49 pm, edited 1 time in total.

lighted
Guru
Posts: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10450 - World Cup Noise, why WA??????

Post by lighted » Thu Dec 25, 2014 5:13 pm

Don't read from file. If you want to edit your post click on "EDIT" button on the top right of your post. Use "X" to delete unnecessary post.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman

NAbdulla
New poster
Posts: 31
Joined: Wed Jul 30, 2014 3:40 pm
Contact:

Re: 10450 - World Cup Noise, why WA??????

Post by NAbdulla » Fri Dec 26, 2014 12:45 pm

thank you

Post Reply

Return to “Volume 104 (10400-10499)”