제출 #964659

#제출 시각아이디문제언어결과실행 시간메모리
964659marinaluca동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h" #include <bits/stdc++.h> #pragma GCC optimize ("O4") #pragma GCC optimize ("fast-math") #pragma GCC optimize ("unroll-loops") using namespace std; /** #define int long long #define ll long long #define all (x) begin(x), end(x) #define xx first #define yy second #define cin fin #define cout fout typedef db double; typedef ldb long double; typedef vii vector <int>; typedef pii pair <int, int>; typedef pai pair <double, double>; ifstream cin ("cave.in"); ofstream cout ("cave.out"); **/ const int NMAX = 5e3; int n; int usa[NMAX + 1]; int sus[NMAX + 1]; void intoarce (int val){ for (int i = 0; i <= val; ++ i){ if (usa[i] == -1) sus[i] ^= 1; } } void init (){ for (int i = 0; i < n; ++ i){ usa[i] = -1; sus[i] = 0; } } bool solve (int k, int poz){ intoarce(k); int rez = tryCombination(sus); intoarce (k); return rez == poz; } void exploreCave (int N){ n = N; init(); for (int i = 0; i < n; ++ i){ int cur = tryCombination(sus); if (cur == i){ intoarce (n - 1); } int st = 0; int dr = n - 1; int Answer = -1; int mijl; while (st <= dr){ mijl = (st + dr) >> 1; if (solve(mijl, i)){ Answer = mijl; dr = mijl - 1; } else st = mijl + 1; } usa[Answer] = i; } answer (sus, usa); }

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

/usr/bin/ld: /tmp/ccn3Lbu6.o: in function `init()':
cave.cpp:(.text+0x190): multiple definition of `init()'; /tmp/ccSxP3S2.o:grader.c:(.text+0x110): first defined here
collect2: error: ld returned 1 exit status