結果

提出番号 105
提出者 kotamanegi
言語 C++
提出日時 2017-05-30 21:31:57
問題名 (10)鉄道
結果 TLE
点数 0%

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 1ms 8112KB
2 AC 100% 1ms 7936KB
3 TLE 0% 2859ms 7744KB
4 TLE 0% 3377ms 7760KB
5 TLE 0% 3464ms 8224KB
6 TLE 0% 2392ms 7968KB
7 TLE 0% 3429ms 7744KB
8 TLE 0% 3335ms 7744KB
9 TLE 0% 2255ms 7760KB
10 TLE 0% 3461ms 7936KB
11 TLE 0% 2849ms 8320KB
12 TLE 0% 2382ms 8336KB

ソースコード

#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream> 
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
long long hoge[10000000] = {};
int main() {
	long long n;
	cin >> n;
	REP(i, n - 1) {
		cin >> hoge[i];
	}
	int q;
	cin >> q;
	REP(i, q) {
		int a, b;
		cin >> a >> b;
		int ans = 0;
		for (int i = a - 1;i < b-1;++i) {
			ans += hoge[i];
		}
		cout << ans << endl;
	}
	return 0;
}