# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631936 | 2022-08-19T07:48:42 Z | Jovan26 | Addk (eJOI21_addk) | C++14 | 16 ms | 1368 KB |
#include<iostream> bool g[100005]; using namespace std; int main(){ int n; cin>>n; int k; cin>>k; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; int q; cin>>q; for(int j=0;j<q;j++){ int x; cin>>x; if(x==1) continue; int l,r,m; cin>>l>>r>>m; int rez = 0; int br = 0; for(int i=l-1;i<l+m-2;i++){ rez+=(i-l+2)*a[i]; g[i] = true; } for(int i=r-1;i>=r-m+1;i--){ rez+=(r-i)*a[i]; g[i] = true; } for(int i=l;i<r;i++){ if(!g[i]) rez+=a[i]*m; } cout<<rez<<endl; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 340 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 7 ms | 980 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 16 ms | 1368 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |