답안 #497989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
497989 2021-12-24T08:14:27 Z IOI_champion_in_1980 콤보 (IOI18_combo) C++14
0 / 100
1 ms 200 KB
#include<bits/stdc++.h>
using namespace std;
int a, b, c, d, e, n, m;
string s, t, st;
int press(string p);

string guess_sequence(int n) {
	st="ABXY";
	for (a=0; a<st.length(); a++)
	{
		string p="";
		p=p+st[a];
		p=p+st[a];
		if (press(p))
		{
			for (b=0; b<st.length(); b++)
			{
				if (b==a) continue;
				string h="";
				h=h+st[a];
				for (c=0; c<st.length(); c++)
				{
					if (c==a) continue;
					h=h+st[b];
					h=h+st[c];
					if (press(h)==3) return h;
				}
			}
		}
	}
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for (a=0; a<st.length(); a++)
      |            ~^~~~~~~~~~~~
combo.cpp:16:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |    for (b=0; b<st.length(); b++)
      |              ~^~~~~~~~~~~~
combo.cpp:21:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for (c=0; c<st.length(); c++)
      |               ~^~~~~~~~~~~~
combo.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 200 KB Output is correct
2 Runtime error 1 ms 200 KB Execution failed because the return code was nonzero
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 200 KB Wrong Answer: invalid press
2 Halted 0 ms 0 KB -