Submission #52021


ソースコード

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
29
30
#include<bits/stdc++.h>
using namespace std;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
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 09:03:13
言語 C++
状態 Accepted
得点 5
ソースコード長 461 Byte
最大実行時間 297 ms
最大メモリ使用量 65808 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 124 ms 13020 KB
1
Input02 AC 128 ms 21736 KB
1
Input03 AC 144 ms 30960 KB
1
Input04 AC 297 ms 48384 KB
1
Input05 AC 259 ms 65808 KB
1