제출 #1201431

#제출 시각아이디문제언어결과실행 시간메모리
1201431YouKnowCipher9월 (APIO24_september)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#include "september.h"
using namespace std;

int solve (int n, int m, vector<int> f, vector<vector<int>> v) {
	vector<pair<int, int>> p(n, {n, 0});
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n - 1; j++) {
            p[v[i][j]].first = min(p[v[i][j]].first, j);
            p[v[i][j]].second = max(p[v[i][j]].second, j);
        }
    }
    vector<int> diff(n, 0);
    for (int i = 1; i < n; i++) {
        diff[p[i].first]++;
        diff[p[i].second]--;
        if (p[par[i]].first <= p[i].second) {
            diff[p[par[i]].first]++;
            diff[p[i].second]--;
        }
    }
    int ans = 0;
    for (int i = 0; i < n - 1; i++) {
        if (i) diff[i] += diff[i - 1];
        if (diff[i] == 0) ans++;
    }
    return ans;
}

컴파일 시 표준 에러 (stderr) 메시지

september.cpp: In function 'int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)':
september.cpp:17:15: error: 'par' was not declared in this scope; did you mean '__pstl::execution::v1::par'?
   17 |         if (p[par[i]].first <= p[i].second) {
      |               ^~~
      |               __pstl::execution::v1::par
In file included from /usr/include/c++/11/pstl/glue_algorithm_defs.h:15,
                 from /usr/include/c++/11/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:65,
                 from september.cpp:1:
/usr/include/c++/11/pstl/execution_defs.h:111:27: note: '__pstl::execution::v1::par' declared here
  111 | constexpr parallel_policy par{};
      |                           ^~~