Submission #1278295

#TimeUsernameProblemLanguageResultExecution timeMemory
1278295mm2302Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

string guess_sequence(int n){
    if(n==3){
        int main_button;
        if(press("A")==1) main_button=0;
        else if(press("B")==1) main_button=1;
        else if(press("X")==1) main_button=2;
        else if(press("Y")==1) main_button=3;
        string s="ABXY";
        for(int i=0;i<4;i++){
            for(int j=0;j<4;j++){
                if(i!=main_button && j!=main_button){
                    string p=string(1, s[main_button])+s[i]+s[j];
                    if(press(p)==3) return p;
                 }
            }
        }
    }
    else return ("jgk");
}
/*
int main() {
	int a, b, c; cin >> a >> b >> c;
	cout << "The sum of these three numbers is " << a + b + c << "\n";
}

Compilation message (stderr)

combo.cpp:26:1: error: unterminated comment
   26 | /*
      | ^
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^