UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#212563#3840. 布朗运动(motion)zhangjiahao01ms1196kbC++343b2024-10-19 11:35:512024-10-19 12:35:35

answer

#include<bits/stdc++.h>
using namespace std;

long long gcd(long long a,long long b) {
    return b==0?a:gcd(b,a%b);
}
int main() {
    long long p=2,q=1;
    int n;
    cin>>n;
    for(int i=1;i<n;i++) {
        p=3*p-q;
        q=(p+q)/3;
    }
    q*=2;
    long long g=gcd(q,p);
    cout<<q*2/g<<'/'<<p/g;
    return 0;
}

Details

小提示:点击横条可展开更详细的信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

3

output:

20/13

result:

wrong answer 1st lines differ - expected: '10/13', found: '20/13'

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 1196kb

input:

7

output:

466/305

result:

wrong answer 1st lines differ - expected: '233/305', found: '466/305'

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

10

output:

8362/5473

result:

wrong answer 1st lines differ - expected: '4181/5473', found: '8362/5473'

Test #4:

score: 0
Wrong Answer
time: 0ms
memory: 1196kb

input:

16

output:

2692538/1762289

result:

wrong answer 1st lines differ - expected: '1346269/1762289', found: '2692538/1762289'

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

21

output:

662320564/433494437

result:

wrong answer 1st lines differ - expected: '331160282/433494437', found: '662320564/433494437'

Test #6:

score: 0
Wrong Answer
time: 0ms
memory: 1196kb

input:

29

output:

1461741184648/956722026041

result:

wrong answer 1st lines differ - expected: '730870592324/956722026041', found: '1461741184648/9567220...

Test #7:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

32

output:

26229881279368/17167680177565

result:

wrong answer 1st lines differ - expected: '13114940639684/17167680177565', found: '26229881279368/17...

Test #8:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

35

output:

470676121843976/308061521170129

result:

wrong answer 1st lines differ - expected: '235338060921988/308061521170129', found: '470676121843976...

Test #9:

score: 0
Wrong Answer
time: 1ms
memory: 1196kb

input:

39

output:

22111758803539028/14472334024676221

result:

wrong answer 1st lines differ - expected: '11055879401769514/14472334024676221', found: '22111758803...

Test #10:

score: 0
Wrong Answer
time: 0ms
memory: 1192kb

input:

40

output:

28944668049352442/18944531186571953

result:

wrong answer 1st lines differ - expected: '14472334024676221/18944531186571953', found: '28944668049...