제출 #1077073

#제출 시각아이디문제언어결과실행 시간메모리
1077073Trent로봇 대회 (IOI23_robot)C++17
컴파일 에러
0 ms0 KiB
#include "beechtree.h" #include "bits/stdc++.h" using namespace std; #define forR(i, x) for(int i = 0; i < (x); ++i) #define REP(i, a, b) for(int i = (a); i < (b); ++i) #define all(x) x.begin(), x.end() #define asst(x) if(!(x)) exit(2) typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<vi> vvi; typedef vector<vll> vvll; vi sub(int T, vi& P) { set<int> in; in.insert(T); int N = P.size(); while(true) { bool hasNew = false; forR(i, N) { if(in.count(P[i]) && !in.count(i)) { hasNew = true; in.insert(i); } } if(!hasNew) break; } vi ret; for(int i : in) ret.push_back(i); return ret; } std::vector<int> beechtree(int N, int M, std::vector<int> P, std::vector<int> C) { vi ret(N); if(N <= 8) { forR(i, N) { vi vals = sub(i, P); sort(all(vals)); bool found = false; do { bool can = vals[0] == i; map<int, int> freq; for(int j : vals) { can = can && P[j] == vals[freq[C[j]]]; ++freq[C[j]]; } found = found || can; } while(next_permutation(all(vals))); ret[i] = found; } } bool can = true; int lasCol = -1; for(int i = N-1; i >= 0; --i) { if(can) { ret[i] = 1; if(lasCol == -1) lasCol = C[i]; else can = can && C[i] == lasCol; } else { ret[i] = 0; } } return ret; }

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

robot.cpp:1:10: fatal error: beechtree.h: No such file or directory
    1 | #include "beechtree.h"
      |          ^~~~~~~~~~~~~
compilation terminated.