Submission #52019


ソースコード

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;
#define int long long
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:02:00
言語 C++
状態 Accepted
得点 5
ソースコード長 483 Byte
最大実行時間 269 ms
最大メモリ使用量 69640 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input01 AC 112 ms 16988 KB
1
Input02 AC 136 ms 25512 KB
1
Input03 AC 137 ms 34932 KB
1
Input04 AC 269 ms 52288 KB
1
Input05 AC 268 ms 69640 KB
1