101122024-03-26 23:35:55VargusSípálya (55 pont)cpp17Wrong answer 0/5578ms6636 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n, k;
    cin >> n >> k;
    deque <ll> x;
    for (ll i = 1; i <= n; ++i)
    {
        ll a;
        cin >> a;
        x.push_front(a);
    }
    ll h = x.back(), db = 0, j = 0;
    for (ll i = n - k; i <= n - 1; ++i)
    {
        ++j;
        db += x[i] - (h - k + j);
    }
    cout << db;

    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2004 KiB
3Wrong answer0/23ms2096 KiB
4Wrong answer0/23ms2232 KiB
5Wrong answer0/23ms2324 KiB
6Wrong answer0/23ms2436 KiB
7Wrong answer0/33ms2536 KiB
8Wrong answer0/16ms3096 KiB
9Wrong answer0/16ms2908 KiB
10Wrong answer0/16ms2908 KiB
11Wrong answer0/16ms2904 KiB
12Wrong answer0/16ms3160 KiB
13Wrong answer0/16ms3116 KiB
14Wrong answer0/26ms3264 KiB
15Wrong answer0/26ms3184 KiB
16Wrong answer0/271ms6268 KiB
17Wrong answer0/271ms6548 KiB
18Wrong answer0/271ms6636 KiB
19Wrong answer0/372ms6368 KiB
20Wrong answer0/271ms6368 KiB
21Wrong answer0/271ms6372 KiB
22Wrong answer0/271ms6372 KiB
23Wrong answer0/271ms6372 KiB
24Wrong answer0/278ms6528 KiB
25Wrong answer0/272ms6516 KiB
26Wrong answer0/271ms6592 KiB
27Wrong answer0/271ms6608 KiB
28Wrong answer0/371ms6484 KiB
29Wrong answer0/371ms6484 KiB
30Wrong answer0/371ms6484 KiB