Submission #629371

# Submission time Handle Problem Language Result Execution time Memory
629371 2022-08-14T12:37:44 Z polys Addk (eJOI21_addk) C++14
0 / 100
2000 ms 20776 KB
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,j;
    cin>>n>>j;
    int A[n];
    for(int k=0;k<n;k++){
        cin>>A[k];
    }
    int q;
    cin>>q;
    int a;
    int l,r,m;
    for(int k=0;k<q;k++){
        cin>>a;
        if(a==1){
            cin>>a;
        }
        else{
            cin>>l>>r>>m;
            l--;
            r--;
            
            int index=1;
            int sum=0;
            for(int k=l;k<((l+r+1)/2);k++){
                sum+=A[k]*index;
                cout<<A[k]<<" "<<index<<endl;
                index++;
            }
            index--;
            if((r-l)%2==0){
                index--;
            }
            for(int k=((l+r+1)/2);k<=r;k++){
                sum+=A[k]*index;
                cout<<A[k]<<" "<<index<<endl;
                index--;
            }
            cout<<sum<<endl;
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2058 ms 19796 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2078 ms 20776 KB Time limit exceeded
2 Halted 0 ms 0 KB -