답안 #909376

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
909376 2024-01-17T07:37:49 Z MinhAnhnd Coreputer (IOI23_coreputer) C++17
컴파일 오류
0 ms 0 KB
#include "coreputer.h"
#include <bits/stdc++.h>
std::vector<int> malfunctioning_cores(int N) {
    vector<int> a;
    for (int i = 0;i<=min(7,N-1);i++){
        a.push_back(i);
    }
    half = run_diagnostic(a);
    vector<int> b;
    for (int i = 0;i<=N-1;i++){
        b.push_back(1);
    }
	return b;
}

Compilation message

coreputer.cpp: In function 'std::vector<int> malfunctioning_cores(int)':
coreputer.cpp:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> a;
      |     ^~~~~~
coreputer.cpp:4:5: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from coreputer.h:1,
                 from coreputer.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from coreputer.h:1,
                 from coreputer.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
coreputer.cpp:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> a;
      |            ^~~
coreputer.cpp:5:23: error: 'min' was not declared in this scope; did you mean 'std::min'?
    5 |     for (int i = 0;i<=min(7,N-1);i++){
      |                       ^~~
      |                       std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from coreputer.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
coreputer.cpp:6:9: error: 'a' was not declared in this scope
    6 |         a.push_back(i);
      |         ^
coreputer.cpp:8:5: error: 'half' was not declared in this scope
    8 |     half = run_diagnostic(a);
      |     ^~~~
coreputer.cpp:8:27: error: 'a' was not declared in this scope
    8 |     half = run_diagnostic(a);
      |                           ^
coreputer.cpp:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> b;
      |            ^~~
coreputer.cpp:11:9: error: 'b' was not declared in this scope
   11 |         b.push_back(1);
      |         ^
coreputer.cpp:13:9: error: 'b' was not declared in this scope
   13 |  return b;
      |         ^