제출 #759542

#제출 시각아이디문제언어결과실행 시간메모리
759542otariusXylophone (JOI18_xylophone)C++17
컴파일 에러
0 ms0 KiB
#include "Xylophone.h" #include <iostream> #include <algorithm> #include <vector> #include <set> #include <cstring> #include <queue> #include <map> #include <cmath> #include <iomanip> using namespace std; #define ff first #define sc second #define pb push_back #define ll long long #define pll pair<ll, ll> #define pii pair <int, int> #define ull unsigned long long // #define int long long // #define int unsigned long long const ll inf = 1e9 + 7; const ll weirdMod = 998244353; bool check(vector<int> v, int n) { set<int> st; for (int u : v) st.insert(u); if (st.size() != n) return false; int cur = 1; for (int u : st) { if (cur == u) cur++; else return false; } return true; } void solve(int n) { int b[n + 1], c[n + 1]; for (int i = 1; i <= n - 1; i++) b[i] = query(i, i + 1); for (int i = 1; i <= n - 2; i++) c[i] = query(i, i + 2); bool flg[n + 1]; /* flg[i] = 1, if a[i] > a[i + 1] flg[i] = 0, if a[i] < a[i + 1] */ flg[1] = 1; for (int i = 2; i <= n - 1; i++) { if (b[i - 1] + b[i] == c[i - 1]) flg[i] = flg[i - 1]; else flg[i] = !flg[i - 1]; } int cur = 1, mn = 1; vector<int> a; for (int i = 2; i <= n; i++) { if (flg[i - 1] == 1) { cur -= b[i - 1]; a.pb(cur); mn = min(mn, cur); } else { cur += b[i - 1]; a.pb(cur); mn = min(mn, cur); } } for (int &v : a) v += -mn + 1; if (check(a, n)) { for (int i = 0; i < a.size(); i++) answer(i + 1, a[i]); return; } cur = 1; mn = 1; a.clear(); for (int i = 2; i <= n; i++) { if (flg[i - 1] == 1) { cur += b[i - 1]; a.pb(cur); mn = min(mn, cur); } else { cur += b[i - 1]; a.pb(cur); mn = min(mn, cur); } } for (int &v : a) v += -mn + 1; for (int i = 0; i < a.size(); i++) answer(i + 1, a[i]); }

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

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