Submission #504801

#TimeUsernameProblemLanguageResultExecution timeMemory
504801Mike4235Speedrun (RMI21_speedrun)C++17
Compilation error
0 ms0 KiB
/*#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,fma")*/ #include <bits/stdc++.h> #define for1(i,a,b) for (int i = a; i <= b; i++) #define for2(i,a,b) for (int i = a; i >= b; i--) #define int long long #define sz(a) (int)a.size() #define pii pair<int,int> #define pb push_back /* __builtin_popcountll(x) : Number of 1-bit __builtin_ctzll(x) : Number of trailing 0 */ const long double PI = 3.1415926535897932384626433832795; const int INF = 1000000000000000000; const int MOD = 1000000007; const int MOD2 = 1000000009; const long double EPS = 1e-6; using namespace std; int now, tin[1005], rev[1005]; vector<int> g[1005]; void dfs(int u, int p) { for1(i,0,9) if (p & (1 << i)) setHint(u, i + 1, 1); tin[u] = ++now; rev[now] = u; for (auto v : g[u]) if (v != p) dfs(v, u); } void assignHints(int subtask, int n, int a[], int b[]) { setHintLen(20); for1(i,1,n) { g[a[i]].push_back(b[i]); g[b[i]].push_back(a[i]); } dfs(1, 0); for1(u,1,n) { for1(i,0,9) if (rev[tin[u] + 1] & (1 << i)) setHint(u, i + 11, 1); } return; } int get(int u, bool p) { int res = 0; for1(i,0,9) { bool t = getHint(i + 1 + p * 10); res ^= (t << i); } return res; } void speedrun(int subtask, int n, int u) { int l = getLength(); while (1) { int v = get(u, 0); if (!v) break; goTo(v); u = v; } while (1) { int v = get(u, 1); if (!v) return; if (goTo(v)) u = v; else { v = get(u, 0); goTo(v); u = v; } } }

Compilation message (stderr)

speedrun.cpp: In function 'void dfs(long long int, long long int)':
speedrun.cpp:32:32: error: 'setHint' was not declared in this scope; did you mean 'setns'?
   32 |  for1(i,0,9) if (p & (1 << i)) setHint(u, i + 1, 1);
      |                                ^~~~~~~
      |                                setns
speedrun.cpp: In function 'void assignHints(long long int, long long int, long long int*, long long int*)':
speedrun.cpp:39:2: error: 'setHintLen' was not declared in this scope
   39 |  setHintLen(20);
      |  ^~~~~~~~~~
speedrun.cpp:48:47: error: 'setHint' was not declared in this scope; did you mean 'setns'?
   48 |   for1(i,0,9) if (rev[tin[u] + 1] & (1 << i)) setHint(u, i + 11, 1);
      |                                               ^~~~~~~
      |                                               setns
speedrun.cpp: In function 'long long int get(long long int, bool)':
speedrun.cpp:56:12: error: 'getHint' was not declared in this scope; did you mean 'getline'?
   56 |   bool t = getHint(i + 1 + p * 10);
      |            ^~~~~~~
      |            getline
speedrun.cpp: In function 'void speedrun(long long int, long long int, long long int)':
speedrun.cpp:63:10: error: 'getLength' was not declared in this scope
   63 |  int l = getLength();
      |          ^~~~~~~~~
speedrun.cpp:67:3: error: 'goTo' was not declared in this scope
   67 |   goTo(v);
      |   ^~~~
speedrun.cpp:74:7: error: 'goTo' was not declared in this scope
   74 |   if (goTo(v)) u = v;
      |       ^~~~
speedrun.cpp:63:6: warning: unused variable 'l' [-Wunused-variable]
   63 |  int l = getLength();
      |      ^