답안 #920412

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
920412 2024-02-02T14:18:59 Z sleepntsheep Rabbit Carrot (LMIO19_triusis) C++17
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <cstring>
#include <vector>
#include <algorithm>
#include <deque>
#include <set>
#include <utility>
#include <array>
#include <complex>
#include <ranges>

using namespace std;
#define ALL(x) begin(x), end(x)
#define ShinLena cin.tie(nullptr)->sync_with_stdio(false);
#define N 200005

int n, m, a[N];
int main()
{
    ShinLena;
    cin >> n >> m;
    for (int i = 1; i <= n; ++i) cin >> a[i];
    cout << *ranges::partition_point(ranges::iota_view(0, n), [&](int x){
            int h = 0;
            for (int i = 1; i <= n; ++i)
            {
                if (a[i] - h > m)
                {
                    if (!x--) return 1;
                    h += m;
                }
                else h = a[i];
            }
            return 0;
        });
}


Compilation message

triusis.cpp: In function 'int main()':
triusis.cpp:27:14: error: 'ranges' has not been declared
   27 |     cout << *ranges::partition_point(ranges::iota_view(0, n), [&](int x){
      |              ^~~~~~
triusis.cpp:27:38: error: 'ranges' has not been declared
   27 |     cout << *ranges::partition_point(ranges::iota_view(0, n), [&](int x){
      |                                      ^~~~~~