组合数方法求助
查看原帖
组合数方法求助
742587
dominant楼主2022/8/24 00:01

IDE上答案正确但是OJ过不了,求大佬解答

#include <bits/stdc++.h>

using namespace std;

int a[31];

unsigned long long int sum = 0;

int main()
{
    #ifndef ONLINE_JUDGE
        freopen("sum.in","r",stdin);
    #endif // ONLINE_JUDGE
    int len = 0;
    while ( cin >> a[len++] )
    {
        sum += a[len-1];
        if ( cin.get() == '\n' )
        {
            break;
        }

    }
    cout << sum * ( long long )(pow(2,len-1));
    return 0;
}

2022/8/24 00:01
加载中...