100332024-03-25 09:31:07VargusSípálya (55 pont)cpp17Wrong answer 0/5583ms28464 KiB
#include <iostream>
#include <queue>
#define ll long long

using namespace std;

int main()
{
    ll n, k;
    cin >> n >> k;
    vector <ll> a(n + 1);
    for (ll i = 1; i <= n; ++i)
        cin >> a[i];
    ll db = 0;
    for (ll i = 2; i <= k; ++i)
    {
        while (a[i] >= a[i - 1])
        {
            --a[i];
            ++db;
        }
    }
    cout << db;
}
SubtaskSumTestVerdictTimeMemory
base0/55
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2056 KiB
3Wrong answer0/23ms2308 KiB
4Wrong answer0/23ms2356 KiB
5Wrong answer0/23ms2468 KiB
6Wrong answer0/23ms2568 KiB
7Wrong answer0/33ms2572 KiB
8Wrong answer0/16ms2916 KiB
9Wrong answer0/16ms3184 KiB
10Wrong answer0/16ms3476 KiB
11Wrong answer0/16ms3460 KiB
12Wrong answer0/16ms3536 KiB
13Wrong answer0/16ms3596 KiB
14Wrong answer0/26ms3784 KiB
15Wrong answer0/26ms3896 KiB
16Wrong answer0/275ms7996 KiB
17Wrong answer0/275ms9340 KiB
18Wrong answer0/275ms10828 KiB
19Wrong answer0/375ms12260 KiB
20Wrong answer0/275ms13756 KiB
21Wrong answer0/275ms14988 KiB
22Wrong answer0/275ms16364 KiB
23Wrong answer0/276ms17984 KiB
24Wrong answer0/283ms19736 KiB
25Wrong answer0/276ms21508 KiB
26Wrong answer0/276ms22768 KiB
27Wrong answer0/275ms24260 KiB
28Wrong answer0/375ms25548 KiB
29Wrong answer0/375ms27020 KiB
30Wrong answer0/376ms28464 KiB