Submission #51992


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include<iostream>
#include<algorithm>
int c[10000000];
using namespace std;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b,d,e,f;
cin >>a;
for(int n=1;n<=a;n++){
cin >>b;
c[n]=c[n-1]+b;
if(n==1) cout <<c[0]<<' ';
cout <<c[n];
if(n!=a) cout <<' ';
}
cout <<'\n';
cin >>a;
for(int n=0;n<a;n++){
cin>>b>>d;
cout <<c[d]-c[b-1]<<'\n';
}
return(0);
}

ステータス

項目 データ
問題 0733 - プログラミング入門:累積和
ユーザー名 ei1923
投稿日時 2019-07-27 20:23:44
言語 C++
状態 Accepted
得点 5
ソースコード長 437 Byte
最大実行時間 399 ms
最大メモリ使用量 104744 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 159 ms 16092 KB
1
Input02 AC 170 ms 27824 KB
1
Input03 AC 161 ms 41088 KB
1
Input04 AC 397 ms 72916 KB
1
Input05 AC 399 ms 104744 KB
1