제출 #849930

#제출 시각아이디문제언어결과실행 시간메모리
849930Andrijanikolic73Combo (IOI18_combo)C++17
5 / 100
1 ms596 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
//#include "combo.h"
/*
int press(string P){
    cout<<"? "<<P;
    cout<<endl;
    int x;
    cin>>x;
    return x;
}*/
std::string guess_sequence(int N) {
    if(N==3){
        string pref="";
        char P[4]={'A','B','X','Y'};
        for(int i=0;i<N;i++){
            for(int j=0;j<4;j++){
                if(press(pref+P[j])==i+1){
                    pref+=P[j];
                    break;
                }
            }
        }
        return pref;
    }
}/*
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    cout<<guess_sequence(n);
}*/

컴파일 시 표준 에러 (stderr) 메시지

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