253042026-02-19 08:40:35PKBVásárlások inflációs hatása (75 pont)cpp17Wrong answer 3/752ms508 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    int N, K;
    cin >> N >> K;

    vector<long long> P(N);
    for(int i = 0; i < N; i++)
        cin >> P[i];

    sort(P.begin(), P.end());

    long long result = 0;
    long long w = 1LL << (N - 1);

    for(int i = 0; i < N; i++) {
        result += P[i] * w;
        w >>= 1;
    }

    cout << result << "\n";
}
SubtaskSumTestVerdictTimeMemory
base3/75
1Accepted0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Accepted1/11ms316 KiB
4Accepted1/11ms316 KiB
5Accepted1/11ms364 KiB
6Wrong answer0/11ms316 KiB
7Wrong answer0/11ms316 KiB
8Wrong answer0/11ms316 KiB
9Wrong answer0/11ms316 KiB
10Wrong answer0/11ms316 KiB
11Wrong answer0/21ms508 KiB
12Wrong answer0/51ms316 KiB
13Wrong answer0/51ms396 KiB
14Wrong answer0/51ms316 KiB
15Wrong answer0/51ms408 KiB
16Wrong answer0/51ms508 KiB
17Wrong answer0/51ms316 KiB
18Wrong answer0/51ms508 KiB
19Wrong answer0/51ms332 KiB
20Wrong answer0/51ms316 KiB
21Wrong answer0/51ms316 KiB
22Wrong answer0/52ms316 KiB
23Wrong answer0/51ms316 KiB
24Wrong answer0/51ms324 KiB