Submission #641935

# Submission time Handle Problem Language Result Execution time Memory
641935 2022-09-17T23:11:23 Z glupan Addk (eJOI21_addk) C++14
0 / 100
2000 ms 508 KB
#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
 
    int n,k;
    cin >> n >> k;
    int a[n];
    for(int i=0; i<n; i++)
        cin >> a[i];
    int q;
    cin >> q;
    while(q--) {
        int x;
        cin >> x;
        if(x==1) {
            int y;
            cin >> y;
        }
        if(x==2) {
            int l,r,m;
            long long ans=0;
            cin >> l >> r >> m;
            l--;
            r--;
            for(int j=0; j<m; j++) {
                for(int i=l; i<r; i++)
                    ans+=a[i];
                l++;
                r--;
            }
            cout << ans << endl;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2071 ms 340 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2077 ms 508 KB Time limit exceeded
2 Halted 0 ms 0 KB -