제출 #648087

#제출 시각아이디문제언어결과실행 시간메모리
648087KenparCombo (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
//OJUZ grind baby

#include "bits/stdc++.h"
using namespace std;
#define ll long long

char word[] = {'A', 'B', 'X', 'Y'};

string nextPermutation(string p, int N){
	if(p.length() == N){
		return ((press(p) == N)?p:"");
	}else{
		string ans = "";
		for(int i = 0; i < 4; i++){
			string temp = p + word[i];

			temp = nextPermutation(temp, N);

			if(temp.length() > ans.length()){
				ans = temp;
			}
		}

		return ans;
	}
}

string guess_sentence(int N){
	return nextPermutation("", N);
}

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

combo.cpp: In function 'std::string nextPermutation(std::string, int)':
combo.cpp:10:16: warning: comparison of integer expressions of different signedness: 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   10 |  if(p.length() == N){
      |     ~~~~~~~~~~~^~~~
combo.cpp:11:12: error: 'press' was not declared in this scope
   11 |   return ((press(p) == N)?p:"");
      |            ^~~~~