Submission #1088165

# Submission time Handle Problem Language Result Execution time Memory
1088165 2024-09-14T04:01:02 Z MahmytM Combo (IOI18_combo) C++17
0 / 100
0 ms 344 KB
#include<bits/stdc++.h>
#include<combo.h>
using namespace std;

string guess_sequence(int n){
	string s="";
	if(press("A")==1){
		s+='A';
		goto pl;
	}
	if(press("B")==1){
		s+='A';
		goto pl;
	}
	if(press("X")==1){
		s+='A';
		goto pl;
	}
	s+='Y';
	pl:;
	for(int i=2;i<=n;i++){
		if('A'==s[0]){
			if(press(s+'B')==s.size()+1){
				s+='B';
				continue;
			}
			if(press(s+'X')==s.size()+1){
				s+='X';
				continue;
			}
			s+='Y';
			continue;
		}else if('B'==s[0]){
			if(press(s+'A')==s.size()+1){
				s+='A';
				continue;
			}
			if(press(s+'X')==s.size()+1){
				s+='X';
				continue;
			}
			s+='Y';
			continue;
		}else if('X'==s[0]){
			if(press(s+'A')==s.size()+1){
				s+='A';
				continue;
			}
			if(press(s+'B')==s.size()+1){
				s+='B';
				continue;
			}
			s+='Y';
			continue;
		}else if('Y'==s[0]){
			if(press(s+'A')==s.size()+1){
				s+='A';
				continue;
			}
			if(press(s+'B')==s.size()+1){
				s+='B';
				continue;
			}
			s+='X';
			continue;
		}
	}
	return s;
}

Compilation message

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |    if(press(s+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:27:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |    if(press(s+'X')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:34:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:38:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |    if(press(s+'X')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:45:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:49:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |    if(press(s+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:56:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |    if(press(s+'A')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
combo.cpp:60:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   60 |    if(press(s+'B')==s.size()+1){
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer: wrong guess.
3 Halted 0 ms 0 KB -