Submission #52018


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
int a;
int q[1000005]={};
int b,c,w;
cin>>a;
for(int i=1;i<=a;i++){
cin>>b;
q[i]=q[i-1]+b;
if(i==1){
cout<<"0 ";
}
cout<<q[i];
if(i!=a){
cout<<" ";
}
}
cout<<"\n";
cin>>a;
for(int i=0;i<a;i++){
cin>>b>>c;
w=q[c]-q[b-1];
cout<<w<<"\n";
}
return(0);
}

ステータス

項目 データ
問題 0733 - プログラミング入門:累積和
ユーザー名 ei1941
投稿日時 2019-07-29 08:59:10
言語 C++
状態 Accepted
得点 5
ソースコード長 436 Byte
最大実行時間 4434 ms
最大メモリ使用量 69880 KB

セット

セット 得点 Cases
1 ALL 5 / 5 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 2052 ms 16988 KB
1
Input02 AC 2208 ms 25664 KB
1
Input03 AC 2302 ms 35108 KB
1
Input04 AC 4434 ms 52496 KB
1
Input05 AC 4367 ms 69880 KB
1