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
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:
Last edited by
abid_iut on Wed Dec 24, 2008 9:36 pm, edited 1 time in total.
Articuno
Learning poster
Posts: 78 Joined: Sun Nov 30, 2008 5:00 pm
Location: IUT-OIC, Dhaka, Bangladesh
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
Post
by abid_iut » Wed Dec 24, 2008 7:46 pm
Thanks Articuno
Got AC
Asma_ju
New poster
Posts: 4 Joined: Sat Jun 11, 2011 9:20 am
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:
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
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:
Post
by alimbubt » Fri Mar 15, 2013 6:17 pm
Input:
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
uDebug
A great helper
Posts: 475 Joined: Tue Jul 24, 2012 4:23 pm
Post
by uDebug » Wed Mar 12, 2014 1:17 pm
Replying to follow the thread.
lighted
Guru
Posts: 587 Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek
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:
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: 587 Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek
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:
Post
by NAbdulla » Fri Dec 26, 2014 12:45 pm
thank you