제출 #753629

#제출 시각아이디문제언어결과실행 시간메모리
753629vjudge1콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
std::string guess_sequence(int N) {
	string p="",c;
	int coins=0;
	for(int i=0;i<4;i++)
	{
		if(coins==1) continue;;
		if(i==0) p="A",c="BXY";
		else if(i==1) p="B",c="AXY";
		else if(i==2) p="X",c="ABY";
		else p="Y",c="ABX";
		coins = press(p);
	}
	int now=1;
	bool BREAK;
	while(1>0)
	{
		BREAK=1;
		string prev=p;
		for(char i : c)
		{
			p+=i;
			coins=press(p);
			if(coins!=now)
			{
				now++;
				BREAK=0;
				break;
			}
			else p=prev;
		}
		if(BREAK) return p;
	}
	return "";
}

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

combo.cpp:1:6: error: 'string' in namespace 'std' does not name a type
    1 | std::string guess_sequence(int N) {
      |      ^~~~~~
combo.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 | std::string guess_sequence(int N) {