Submission #197706

#TimeUsernameProblemLanguageResultExecution timeMemory
197706kshitij_sodaniCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <iostream> #include <bits/stdc++.h> using namespace std; typedef long long int llo; #define mp make_pair #define pb push_back int press(string p){}; string guess_sequence(int n){ string s=""; int aa; aa=press(s+"A"); if(aa==1){ s+="A";} else{ aa=press(s+"B"); if(aa==1){ s+="B"; } else{ aa=press(s+"X"); if(aa==1){ s+="X"; } else{ s+="Y"; } } } string b="B"; string x="X"; string y="Y"; if(s=="B"){ b="A"; } else if(s=="X"){ x="A"; } else if(s=="Y"){ y="A"; } for(int co=1;co<n;co++){ aa=press(s+b+s+x+y+s+x+x+s+x+b); if(aa==co){ s+=y; } else if(aa==co+1){ s+=b; } else{ s+=x; } } aa=press(s+b); if(aa==n){ s+=b; } else{ aa=press(s+x); if(aa==n){ s+=x; } else{ s+=y; } } return s; } int main(){ return 0; }

Compilation message (stderr)

combo.cpp: In function 'int press(std::string)':
combo.cpp:7:21: warning: no return statement in function returning non-void [-Wreturn-type]
    7 | int press(string p){};
      |                     ^
/usr/bin/ld: /tmp/ccOUEoRN.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/ccbE5xTN.o:combo.cpp:(.text.unlikely+0x0): first defined here
/usr/bin/ld: /tmp/ccOUEoRN.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccbE5xTN.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status