Submission #562970

#TimeUsernameProblemLanguageResultExecution timeMemory
562970aryan12Amusement Park (JOI17_amusement_park)C++17
Compilation error
0 ms0 KiB
#include "Ioi.h" #include <bits/stdc++.h> using namespace std; #define MAXN 10010 #define INF 1000000000 static vector<int> g[MAXN]; static vector<long long> dist(MAXN, INF); static vector<bool> vis(MAXN, false); static vector<int> parent(MAXN); static long long ans = 0, subtask; static set<int> already_taken; static int Find(int x) { if(x == parent[x]) return x; return parent[x] = Find(parent[x]); } static void Unite(int a, int b) { a = Find(a), b = Find(b); parent[a] = b; } static void dfs(int node, int par, long long val) { // cout << "node = " << node << ", val = " << val << "\n"; // cout << "ans = " << ans << "\n"; if(subtask == 3 && vis[node % 60]) { assert(par != -1); int value = Move(par); return; } if(subtask == 3) vis[node % 60] = true; if(subtask <= 2 && vis[node]) { assert(par != -1); int value = Move(par); return; } if(subtask == 2) vis[node] = true; if(val == 1 && !already_taken.count(node % 60)) { long long x = node % 60; ans += (1LL << x); already_taken.insert(x); } for(int to: g[node]) { // cout << "to: " << to << "\n"; if(!vis[to] || (subtask == 3 && !vis[to % 60])) { int value = Move(to); dfs(to, node, value); } } if(par != -1) { int value = Move(par); } } long long Ioi(int N, int M, int A[], int B[], int P, int V, int T) { subtask = T; // cout << "hello" << endl; for(long long i = 0; i < N; i++) { parent[i] = i; } int cnt = 0; for(int i = 0; i < M; i++) { if(Find(A[i]) != Find(B[i])) { Unite(A[i], B[i]); g[A[i]].push_back(B[i]); g[B[i]].push_back(A[i]); cnt++; } } // cout << "hello" << endl; assert(cnt == N - 1); // cout << "hello x2" << endl; dfs(P, -1, (long long)(V)); // cout << "hello x3" << endl; return ans; }

Compilation message (stderr)

Joi.cpp: In function 'void dfs(int, int, long long int)':
Joi.cpp:35:21: error: 'Move' was not declared in this scope
   35 |         int value = Move(par);
      |                     ^~~~
Joi.cpp:35:13: warning: unused variable 'value' [-Wunused-variable]
   35 |         int value = Move(par);
      |             ^~~~~
Joi.cpp:42:21: error: 'Move' was not declared in this scope
   42 |         int value = Move(par);
      |                     ^~~~
Joi.cpp:42:13: warning: unused variable 'value' [-Wunused-variable]
   42 |         int value = Move(par);
      |             ^~~~~
Joi.cpp:57:25: error: 'Move' was not declared in this scope
   57 |             int value = Move(to);
      |                         ^~~~
Joi.cpp:63:21: error: 'Move' was not declared in this scope
   63 |         int value = Move(par);
      |                     ^~~~
Joi.cpp:63:13: warning: unused variable 'value' [-Wunused-variable]
   63 |         int value = Move(par);
      |             ^~~~~

/usr/bin/ld: /tmp/cc4w0aIh.o: in function `main':
grader_ioi.cpp:(.text.startup+0x3f2): undefined reference to `Ioi(int, int, int*, int*, int, int, int)'
collect2: error: ld returned 1 exit status