| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1038390 | tarpent | Addk (eJOI21_addk) | C++14 | 993 ms | 5196 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll maxn = 1e5+7;
ll n,k,q,tre,tz,l,r,m;
ll pre[maxn];
int main(){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0);
cin>>n>>k;
for(ll i = 0; i<n; i++){
cin>>tre;
pre[i+1]=pre[i]+tre;
}
cin>>q;
for(ll i = 0;i<q; i++){
cin>>tre;
if(tre==1){
cin>>l;
}
else{
cin>>l>>r>>m;
ll od = 0;
int f = min(m,(r-l+1)-m+1);
for(ll p = 0; p<f; p++){
od+=pre[r]-pre[l-1];
r--;
l++;
}
cout<<od<<'\n';
}
}
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
