| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 501098 | uncripted | Addk (eJOI21_addk) | C++11 | 119 ms | 2584 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
long long prefix[100005];
long long pre[10005];
int main(){
long long n,k;
cin>>n>>k;
long long a[n+1];
for(long long i=1; i<=n; i++){
cin>>a[i];
pre[i]+=pre[i-1]+a[i];
prefix[i]=prefix[i-1]+pre[i];
}
long long q;
cin>>q;
while(q--){
long long x;
cin>>x;
if(x==1){
int y;
cin>>y;
continue;
}
long long l,r,m;
cin>>l>>r>>m;
long long s=0;
s+=prefix[r]-prefix[l+m-2];
s-=prefix[r-m]-prefix[l-2];
cout<<s<<endl;
}
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
