Submission #269299

#TimeUsernameProblemLanguageResultExecution timeMemory
269299Bill_00Combo (IOI18_combo)C++14
10 / 100
106 ms544 KiB
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
int coins;
std::string guess_sequence(int n){
	string p="";
	for(int i=1;i<=n;i++){
		coins=press(p+'A');
		if(coins==p.size()+1){
			p+='A';
			continue;
		}
		coins=press(p+'B');
		if(coins==p.size()+1){
			p+='B';
			continue;
		}
		coins=press(p+'X');
		if(coins==p.size()+1){
			p+='X';
			continue;
		}
		coins=press(p+'Y');
		if(coins==p.size()+1){
			p+='Y';
			continue;
		}
	}
	return p;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |   if(coins==p.size()+1){
      |      ~~~~~^~~~~~~~~~~~
combo.cpp:14:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |   if(coins==p.size()+1){
      |      ~~~~~^~~~~~~~~~~~
combo.cpp:19:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |   if(coins==p.size()+1){
      |      ~~~~~^~~~~~~~~~~~
combo.cpp:24:11: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |   if(coins==p.size()+1){
      |      ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...