心态崩了呀

P1009 [NOIP1998 普及组] 阶乘之和

Xiaonao_Dali @ 2023-12-24 08:52:37

#include <cstdio>
int main(){
    long long n, sum = 0, ans = 1;
    scanf("%lld", &n);
    for (int i = 1; i <= n; i++){
        for (int j = i; j >= 1; j--){
            ans *= j;
        }
        sum += ans;
        ans = 1;
    }
    printf("%lld", sum);
    return 0;
}

by Escapism @ 2023-12-24 08:56:41

@_includecstdio 本题需要用高精度。


by Michelle01 @ 2023-12-24 08:56:41

@_includecstdio 这一题需要高精度OvO来做,因为题目数据点中最大的乘积范围已经超过long long 范围了


by Xiaonao_Dali @ 2023-12-24 09:00:21

但我不知道高精度呀,还是我太年轻


by CHkuakeU @ 2023-12-31 10:26:45

题目让用高精度啊

虽然我也不会


|