/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Wrong Answer 1ms 536.0 KiB
#3 Wrong Answer 1ms 532.0 KiB

Code

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

#define ll long long
#define endl '\n'
#define print(v) for(auto e:v) cout<<e<<" "; cout<<endl;
const int mod = 1e9 + 7;
long long Pow(ll a,ll b){
    ll ans = 1;
    while(b>0){
        if(b&1) ans*=a;
        b>>=1;
        a*=a;
    }
    return ans;
}
ll gcd(ll a, ll b) {
    while (b != 0) {
        ll temp = b;
        b = a % b;
        a = temp;
    }
    return a;
}
void solve() {
    int n; cin >> n;
    ll ki = Pow(2 , n-1);
    ll ans = 0;
    vector<int>p(n);
    for(int i = 0 ;i < n ; i++) {
        cin >> p[i];
        ans += ((p[i] % mod) * ( ki % mod) ) % mod;
    }
    cout << ans << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 1; cin >> t;
    while(t--){
        solve();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1105 Ohh that gcd again
Contest
LUCC Presents Kick & Code Intra LU Programming Contest
Language
C++17 (G++ 13.2.0)
Submit At
2025-09-01 06:16:36
Judged At
2025-09-01 06:16:36
Judged By
Score
10
Total Time
1ms
Peak Memory
536.0 KiB