Submission #755847

#TimeUsernameProblemLanguageResultExecution timeMemory
755847vjudge1Password (RMI18_password)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "C:\GCC\debug.h" #else #define debug(...) void(42) #endif int query(string str) { } string guess(int n, int s) { string endChars; vector<int> freq(s); for (int i = 0; i < s; i++) { string str; for (int it = 0; it < n; it++) { str += (i + 'a'); } freq[i] = query(str); if (freq[i] == n) { return str; } } for (int pos = n - 1; pos >= 0; pos--) { for (int i = 0; i < s; i++) { string build; for (int it = 0; it < freq[i]; it++) { build += (i + 'a'); } bool work = true; for (int j = 0; j < s; j++) { string tmp; tmp += build; tmp += (j + 'a'); tmp += endChars; if (query(tmp) == (int) tmp.length()) { work = false; break; } } if (work) { endChars.insert(endChars.begin(), i + 'a'); break; } } } return endChars; } int main() { ios::sync_with_stdio(false); cin.tie(0); return 0; }

Compilation message (stderr)

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