Submission #1042778

# Submission time Handle Problem Language Result Execution time Memory
1042778 2024-08-03T11:24:18 Z Alexe1900 Addk (eJOI21_addk) C++14
0 / 100
165 ms 3280 KB
#include <bits/stdc++.h>

using namespace std;

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    long long n, k;
    cin >> n >> k;

    vector<long long> prefixsums;

    prefixsums.push_back(0);

    for (long long i = 0; i < n; i++) {
        long long a; cin >> a;
        prefixsums.push_back(a + prefixsums[i]);
    }

    long long q; cin >> q;
    for (long long i = 0; i < n; i++) {
        long long a; cin >> a;
        if (a == 1) {
            for (long long j = 0; j < k; j++) {
                long long b; cin >> b;
            }
        } else {
            long long l, r, m, s=0; cin >> l >> r >> m;
            for (long long j = 0; j < min(m, (r-l+1)/2); j++) {
                s += prefixsums[r+1] - prefixsums[l+1];
                l++;
                r--;
            }
            cout << s << "\n";
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 70 ms 1516 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 165 ms 3280 KB Output isn't correct
2 Halted 0 ms 0 KB -