Submission #154057

#TimeUsernameProblemLanguageResultExecution timeMemory
154057nthoangCombo (IOI18_combo)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #ifdef LOCAL #include "/Users/nth842002/Library/debug.h" #endif using namespace std; const char moves[] = {'A', 'B', 'X', 'Y'}; int press(string p) { } string guess_sequence(int n) { for (int mask = 0; mask < (1 << (n + n)); mask++) { string s; s.resize(n); for (int i = 0, t = mask; i < n; i++) { s[i] = moves[t % 4]; t /= 4; } if (press(s) == n) { return s; } } } int main() { }

Compilation message (stderr)

combo.cpp: In function 'int press(std::string)':
combo.cpp:12:1: warning: no return statement in function returning non-void [-Wreturn-type]
   12 | }
      | ^
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:26:1: warning: control reaches end of non-void function [-Wreturn-type]
   26 | }
      | ^
/usr/bin/ld: /tmp/ccvuQjy2.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccZ1fjkZ.o:combo.cpp:(.text.unlikely+0x0): first defined here
/usr/bin/ld: /tmp/ccvuQjy2.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccZ1fjkZ.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status