## 10450 - World Cup Noise

Moderator: Board moderators

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

### Re: 10450 - World Cup Noise

why WA I have all the input(I think)
is there any more problem?
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

### Re: 10450 - World Cup Noise

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

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:

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

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

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
Contact:

### Re: 10450 - World Cup Noise

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/

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

### Re: 10450 - World Cup Noise

Check input and AC output for over 7,500 problems on uDebug!

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

### Re: 10450 - World Cup Noise

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

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

### Re: 10450 - World Cup Noise

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??????

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

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

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

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:

thank you