답안 #768279

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
768279 2023-06-27T21:05:29 Z elotelo966 Addk (eJOI21_addk) C++17
36 / 100
2000 ms 1956 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define OYY 1000000005
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mid (start+end)/2
int dizi[1000005];

int32_t main(){
    fast
    int n,m,deg,cev;cin>>n>>m;
    for(int i=1;i<=n;i++){
        cin>>deg;
        dizi[i]=dizi[i-1]+deg;
    }
    int q;cin>>q;
    while(q--){
        int ty;cin>>ty;
        if(ty==2){
            int l,r,m;
            cev=0;
            cin>>l>>r>>m;
            for(int i=l+m-1;i<=r;i++){
                cev+=dizi[i]-dizi[i-m];
            }
            cout<<cev<<'\n';
        }
        else{
            for(int i=0;i<m;i++)cin>>deg;
        }
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 3 ms 340 KB Output is correct
5 Correct 5 ms 372 KB Output is correct
6 Correct 8 ms 400 KB Output is correct
7 Correct 10 ms 420 KB Output is correct
8 Correct 13 ms 416 KB Output is correct
9 Correct 26 ms 416 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 96 ms 688 KB Output is correct
2 Correct 207 ms 968 KB Output is correct
3 Correct 374 ms 1188 KB Output is correct
4 Correct 1522 ms 1916 KB Output is correct
5 Execution timed out 2083 ms 1956 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 614 ms 1300 KB Output isn't correct
2 Halted 0 ms 0 KB -