제출 #777605

#제출 시각아이디문제언어결과실행 시간메모리
777605ihcekerAddk (eJOI21_addk)C++14
0 / 100
92 ms2952 KiB
#include<bits/stdc++.h> #define int long long #define MOD 1000000007 #define all(x) x.begin(),x.end() #define ff first #define ss second #define pb push_back #define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); using namespace std; int32_t main(){ int n,k; cin>>n>>k; int arr[n+5],pre[n+5]; pre[0]=0; for(int i=1;i<=n;i++){ cin>>arr[i]; pre[i]=pre[i-1]+arr[i]; } int q; cin>>q; while(q--){ int a; cin>>a; if(a==1){ int b[k]; for(int i=0;i<k;i++)cin>>b[i]; } else{ int x,y; cin>>x>>y; cout<<pre[y]-pre[x-1]<<endl; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...