제출 #645091

#제출 시각아이디문제언어결과실행 시간메모리
645091Nursik콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include "combo.h" #include <random> #include <iostream> using namespace std; #define ll long long #define pb push_back const ll maxn = 2e3 + 1; int used[maxn][4]; vector<char> v = {'A', 'B', 'X', 'Y'}; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); string guess_sequence(int n) { string pref = ""; int get = press("AB"); if (get > 0){ get = press("A"); if (get == 1){ pref += "A"; } else{ pref += "B"; } } else{ get = press("X"); if (get == 1){ pref += "X"; } else{ pref += "Y"; } } vector<char> v2; for (auto it : v){ if (it != pref[0]){ v2.pb(it); } } for (int i = pref.size(); i < n;){ for (int j = 0; j < 3; ++j){ int k = rng() % (j + 1); swap(v2[j], v2[k]); } int ans = 2; for (int j = 0; j < 2; ++j){ string npref = pref; for (int k = 0; k < n; ++k){ npref += v2[j]; } get = press(npref); if (get >= i + 1){ ans = j; int kol = get - (i + 1) + 1; for (int k = 1; k <= kol; ++k){ pref += v2[j]; } break; } } if (ans == 2){ pref += v2[ans]; } i = pref.size(); } return pref; }

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

combo.cpp:13:13: error: 'chrono' has not been declared
   13 | mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
      |             ^~~~~~