UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#212528#3840. 布朗运动(motion)Panjunnan00ms1240kbC++637b2024-10-19 10:48:112024-10-19 12:34:04

answer

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}

int main() {
    int n;
    cin >> n;

    vector<int> dp(n + 2, 0);
    dp[n] = 1; 

    for (int i = n - 1; i >= 1; --i) {
        dp[i] = dp[i + 1] * (i + 1) / (2 * (i + 1) - 1);
    }

    int numerator = dp[1];
    int denominator = 1; 


    int common_divisor = gcd(numerator, denominator);
    numerator /= common_divisor;
    denominator /= common_divisor;


    cout << numerator << "/" << denominator << endl;

    return 0;
}

详细

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

Test #1:

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

input:

3

output:

0/1

result:

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

Test #2:

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

input:

7

output:

0/1

result:

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

Test #3:

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

input:

10

output:

0/1

result:

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

Test #4:

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

input:

16

output:

0/1

result:

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

Test #5:

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

input:

21

output:

0/1

result:

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

Test #6:

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

input:

29

output:

0/1

result:

wrong answer 1st lines differ - expected: '730870592324/956722026041', found: '0/1'

Test #7:

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

input:

32

output:

0/1

result:

wrong answer 1st lines differ - expected: '13114940639684/17167680177565', found: '0/1'

Test #8:

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

input:

35

output:

0/1

result:

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

Test #9:

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

input:

39

output:

0/1

result:

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

Test #10:

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

input:

40

output:

0/1

result:

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