Submission #1310711

#TimeUsernameProblemLanguageResultExecution timeMemory
1310711dimitri.shengelia동굴 (IOI13_cave)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> //#include "cave.h" using namespace std; int tryCombination ( int S[] ); void answer( int S[], int D[] ); void exploreCave( int n ) { int a[n], b[n]; fill ( a, a + n, 0 ); fill ( b, b + n, -1 ); if ( n <= 100 ) { int k, k1; while ( true ) { k = tryCombination( a ); for ( int i = 0; i < n; i++ ) { a[i] = 1 - a[i]; k1 = tryCombination( a ); if ( k1 != -1 and ( k1 < k or k == -1 ) ) { b[i] = k1; } a[i] = 1 - a[i]; } if ( k == -1 ) { answer( a, b ); } for ( int i = 0; i < n; i++ ) { if ( b[i] != -1 ) { continue; } a[i] = 0; k1 = tryCombination( a ); if ( k1 > k or k1 == -1 ) { break; } a[i] = 1; k1 = tryCombination( a ); if ( k1 > k or k1 == -1 ) { break; } } } } if ( tryCombination ( a ) != -1 ) { for ( int i = 0; i < n; i++ ) { a[i] = 0; b[i] = i; if ( tryCombination ( a ) == i ) { a[i] = 1; } } answer( a, b ); } else { for ( int i = 0; i < n; i++ ) { a[i] = 1; b[i] = tryCombination ( a ); a[i] = 0; } answer( a, b ); } return; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccSbkhkR.o: in function `main':
grader.c:(.text.startup+0x10): undefined reference to `exploreCave'
/usr/bin/ld: /tmp/cc4poK5Y.o: in function `exploreCave(int)':
cave.cpp:(.text+0xf9): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x139): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x170): undefined reference to `answer(int*, int*)'
/usr/bin/ld: cave.cpp:(.text+0x178): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x1af): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x1c8): undefined reference to `answer(int*, int*)'
/usr/bin/ld: cave.cpp:(.text+0x1e0): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x206): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x225): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x245): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x267): undefined reference to `answer(int*, int*)'
/usr/bin/ld: cave.cpp:(.text+0x297): undefined reference to `tryCombination(int*)'
/usr/bin/ld: cave.cpp:(.text+0x2b7): undefined reference to `answer(int*, int*)'
collect2: error: ld returned 1 exit status