Submission #138164

#TimeUsernameProblemLanguageResultExecution timeMemory
138164ly20Combo (IOI18_combo)C++17
5 / 100
2 ms256 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; map<int,char> mp; string guess_sequence(int N) { string p="A"; for(int i=1;i<N;i++)p.push_back('B'); mp[0]='A'; mp[1]='B'; mp[2]='X'; mp[3]='Y'; for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { for(int k=0;k<4;k++) { if(N==3){p[0]=mp[i];p[1]=mp[j];p[2]=mp[k];} if(N==1)p[0]=mp[i]; if(N==2){p[0]=mp[i];p[1]=mp[j];} if(N==2 && p[0]==p[1])continue; if(N==3 && (p[1]==p[0] || p[2]==p[0]))continue; if(press(p)==N)return p; } } } }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...