結果

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

テストケース

テストケース 結果 得点 実行時間 メモリ使用量
1 AC 100% 2ms 7936KB
2 AC 100% 1ms 8080KB
3 TLE 0% 2216ms 7776KB
4 TLE 0% 2496ms 8208KB
5 TLE 0% 2350ms 8208KB
6 TLE 0% 2252ms 7968KB
7 TLE 0% 3340ms 7984KB
8 TLE 0% 2811ms 8336KB
9 TLE 0% 2208ms 8112KB
10 TLE 0% 2220ms 8160KB
11 TLE 0% 2209ms 7968KB
12 TLE 0% 2457ms 7984KB

ソースコード

#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;
}