233982026-01-21 17:53:36GergoszaboBájital (80 pont)cpp17Wrong answer 12/8039ms988 KiB
#include <iostream>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;

int main()
{
    int n, x; cin >> n >> x;
    vector<int> v(n);
    for (int i = 0; i < n; i++){
        cin >> v[i];
    }
    ll forradag = 0;
    ll ontadag = 0;
    for (int i = 0; i < n; i++){
        if (v[i] < x) forradag += v[i];
        else {
            ontadag += v[i] / x; forradag += v[i] % x;
        }
    }
    //forradag += ontadag % x;
    ll ans = 0;
    if (forradag >= ontadag) ans = ontadag;
    else ans = forradag;
    cout << ans;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base12/80
1Accepted0/01ms316 KiB
2Wrong answer0/01ms512 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/237ms564 KiB
10Wrong answer0/237ms564 KiB
11Wrong answer0/237ms796 KiB
12Wrong answer0/237ms808 KiB
13Wrong answer0/237ms564 KiB
14Wrong answer0/237ms824 KiB
15Wrong answer0/237ms800 KiB
16Wrong answer0/237ms564 KiB
17Wrong answer0/237ms564 KiB
18Wrong answer0/237ms812 KiB
19Wrong answer0/237ms988 KiB
20Wrong answer0/237ms796 KiB
21Wrong answer0/237ms796 KiB
22Wrong answer0/237ms564 KiB
23Wrong answer0/41ms316 KiB
24Accepted4/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Accepted4/421ms636 KiB
27Wrong answer0/437ms564 KiB
28Wrong answer0/437ms580 KiB
29Wrong answer0/439ms564 KiB
30Accepted2/237ms804 KiB
31Accepted2/237ms832 KiB
32Wrong answer0/237ms800 KiB
33Wrong answer0/237ms564 KiB