Submission #232294

#TimeUsernameProblemLanguageResultExecution timeMemory
232294jhtanCombo (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <iostream> using namespace std; std::string guess_sequence(int N) { string s = "", V=""; // 5 points /* if (press("A") == 1) s += "A"; else if (press("B") == 1) s += "B"; else if (press("X") == 1) s += "X"; else if (press("Y") == 1) s += "Y"; if (press(s + "A") == 2) s += "A"; else if (press(s + "B") == 2) s += "B"; else if (press(s + "X") == 2) s += "X"; else if (press(s + "Y") == 2) s += "Y"; if (press(s + "A") == 3) s += "A"; else if (press(s + "B") == 3) s += "B"; else if (press(s + "X") == 3) s += "X"; else if (press(s + "Y") == 3) s += "Y"; */ // 10 points /* for(int i=0; i<N; i++) { if (press(s + "A") == i+1) s += "A"; else if (press(s + "B") == i+1) s += "B"; else if (press(s + "X") == i+1) s += "X"; else if (press(s + "Y") == i+1) s += "Y"; } */ // 10 points -___- /* if (press("A") == 1) { s += "A", V = "BXY"; } else if (press("B") == 1) { s += "B", V = "AXY"; } else if (press("X") == 1) { s += "X", V = "ABY"; } else if (press("Y") == 1) { s += "Y", V = "ABX"; } for(int i=1; i<N; i++) { if (press(s + V[0]) == i+1) s += V[0]; else if (press(s + V[1]) == i+1) s += V[1]; else if (press(s + V[2]) == i+1) s += V[2]; } */ // mas puntints BXY AB == AX if(press("AB") >= 1) { if (press("A") == 1) { s += "A", V = "BXY"; } else { s += "B", V = "AXY"; } } else { if (press("X") == 1) { s += "X", V = "ABY"; } else { s += "Y", V = "ABX"; } } cout << "s = " << s << endl; for(int i=1; i<N; i++) { int p1 = press(s + V[0]); int p2 = press(s + V[1]); if(p1 > p2) s += V[0]; else if (p2 > p1) s += V[1]; else s += V[2]; cout << "s = " << s << endl; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...