Submission #1657665


Source Code Expand

Copy
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main() {
    int n, c;
    cin >> n >> c;
    int l[n];
    for (int i = 0; i < n; i++) {
        cin >> l[i];
    }

    int p = 0;
    int count = 0;
    while (p < n) {
        if (l[p] + l[p + 1] + 1 <= c) p++;
        count++;
        p++;
    }
    cout << count << endl;
    return 0;
}

Submission Info

Submission Time
Task C - 収納
User madman6
Language C++14 (GCC 5.4.1)
Score 0
Code Size 402 Byte
Status
Exec Time 54 ms
Memory 640 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 0 / 300 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt 53 ms 640 KB
02.txt 54 ms 640 KB
03.txt 31 ms 640 KB
04.txt 50 ms 640 KB
05.txt 26 ms 640 KB
06.txt 19 ms 640 KB
07.txt 32 ms 640 KB
08.txt 36 ms 640 KB
09.txt 41 ms 640 KB
10.txt 19 ms 640 KB
11.txt 53 ms 640 KB
12.txt 54 ms 640 KB
13.txt 28 ms 640 KB
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
sample_03.txt 1 ms 256 KB