Submission #379372


Source Code Expand

Copy
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int main() {
	int N, K, t[100001];
	
	cin >> N >> K;
	
	for (int i = 0; i < N; i++) {
		cin >> t[i];
		if (i >= 2 && t[i - 2] + t[i - 1] + t[i] < K) {
			cout << (i + 1) << endl;
			return 0;
		}
	}
	
	cout << -1 << endl;
	
	return 0;
}

Submission Info

Submission Time
Task A - ぐっすり
User iwashi31
Language C++ (GCC 4.9.2)
Score 100
Code Size 501 Byte
Status
Exec Time 65 ms
Memory 1136 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 100 / 100 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask1_16.txt, subtask1_17.txt, subtask1_18.txt, subtask1_19.txt, subtask1_20.txt, subtask1_21.txt, subtask1_22.txt, subtask1_23.txt, subtask1_24.txt, subtask1_25.txt, subtask1_26.txt, subtask1_27.txt, subtask1_28.txt, subtask1_29.txt, subtask1_30.txt, subtask1_31.txt
Case Name Status Exec Time Memory
sample_01.txt 25 ms 800 KB
sample_02.txt 22 ms 796 KB
sample_03.txt 22 ms 800 KB
subtask1_01.txt 22 ms 800 KB
subtask1_02.txt 24 ms 924 KB
subtask1_03.txt 22 ms 796 KB
subtask1_04.txt 22 ms 928 KB
subtask1_05.txt 22 ms 932 KB
subtask1_06.txt 24 ms 800 KB
subtask1_07.txt 24 ms 928 KB
subtask1_08.txt 23 ms 936 KB
subtask1_09.txt 22 ms 804 KB
subtask1_10.txt 22 ms 800 KB
subtask1_11.txt 24 ms 800 KB
subtask1_12.txt 24 ms 800 KB
subtask1_13.txt 36 ms 920 KB
subtask1_14.txt 22 ms 800 KB
subtask1_15.txt 22 ms 932 KB
subtask1_16.txt 23 ms 796 KB
subtask1_17.txt 24 ms 796 KB
subtask1_18.txt 24 ms 928 KB
subtask1_19.txt 24 ms 928 KB
subtask1_20.txt 22 ms 796 KB
subtask1_21.txt 24 ms 928 KB
subtask1_22.txt 52 ms 1064 KB
subtask1_23.txt 24 ms 920 KB
subtask1_24.txt 25 ms 932 KB
subtask1_25.txt 22 ms 928 KB
subtask1_26.txt 22 ms 932 KB
subtask1_27.txt 22 ms 800 KB
subtask1_28.txt 23 ms 928 KB
subtask1_29.txt 22 ms 924 KB
subtask1_30.txt 65 ms 1136 KB
subtask1_31.txt 22 ms 924 KB