Submission #547523

#TimeUsernameProblemLanguageResultExecution timeMemory
547523beaconmcCave (IOI13_cave)C++14
Compilation error
0 ms0 KiB
#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <bits/stdc++.h> #include "cave.h" typedef long long ll; using namespace std; using namespace __gnu_pbds; #define FOR(i, x, y) for(int i=x; i<y; i++) #define FORNEG(i, x, y) for(ll i=x; i>y; i--) #define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL) #define ll int vector<ll> inv(4); ll tryCombination(int ans[4]){ vector<ll> sus = {3,1,0,2}; vector<ll> sussy = {1,1,1,0}; FOR(i,0,4){ if (sussy[inv[i]] != ans[inv[i]]){ return i; } } return -1; } vector<vector<ll>> found; ll test(int N, int n){ ll ans[N+1]; FOR(i,0,N){ ans[i] = 0; } for (auto&i : found){ ans[i[1]] = i[2]; } ll result = tryCombination(ans); if (result>n || result==-1){ return 0; }else{ return 1; } } ll test2(int n, int k, int s){ k++; ll ans[n+1]; FOR(i,0,n){ ans[i] = 0; } FOR(i,0,k) ans[i] = s; FOR(i,k,n){ if (s==0) ans[i] = 1; else ans[i] = 0; } for (auto&i : found){ ans[i[1]] = i[2]; } ll result = tryCombination(ans); if (result>k || result==-1){ return 1; }else{ return 0; } } void exploreCave(int N){ FOR(i,0,N){ ll switchd = test(N,i); ll lo = 0; ll hi = N-1; ll mid = 0; while (lo < hi) { mid = lo + (hi - lo) / 2; if (test2(N, mid, switchd)) { hi = mid; } else { lo = mid + 1; } }; found.push_back({i, lo, switchd}); } ll S[N]; ll D[N]; for (auto&i : found){ S[i[1]] = i[2]; D[i[1]] = i[0]; } answer(S,D); }

Compilation message (stderr)

/usr/bin/ld: /tmp/cciu0fKm.o: in function `tryCombination':
cave.cpp:(.text+0x0): multiple definition of `tryCombination'; /tmp/ccSXGdtl.o:grader.c:(.text+0x80): first defined here
collect2: error: ld returned 1 exit status