제출 #1153588

#제출 시각아이디문제언어결과실행 시간메모리
1153588lrnnz9월 (APIO24_september)C++17
컴파일 에러
0 ms0 KiB
#include "september.h" #include <vector> int solve(int N, int M, std::vector<int> F, std::vector<std::vector<int>> S) { int ans = 0; int diffs = 0; map<int,int> cnts; for (int i = N-2; i >= 0; i--){ for (auto x : S){ int node = x[i]; cnts[node]++; if (cnts[node] == 1){ diffs++; } if (cnts[node] == M){ diffs--; } } if (diffs == 0) ans++; } return ans; }

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

september.cpp: In function 'int solve(int, int, std::vector<int>, std::vector<std::vector<int> >)':
september.cpp:8:5: error: 'map' was not declared in this scope
    8 |     map<int,int> cnts;
      |     ^~~
september.cpp:8:9: error: expected primary-expression before 'int'
    8 |     map<int,int> cnts;
      |         ^~~
september.cpp:13:13: error: 'cnts' was not declared in this scope
   13 |             cnts[node]++;
      |             ^~~~