Submission #415131

#TimeUsernameProblemLanguageResultExecution timeMemory
415131aris12345678Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; const int mxN = 2005; string guess_sequence(int n) { string comb = "AABBXXYY"; for(int i = 0; i < comb.length(); i++) { string p = comb[i]; for(int j = 0; j < comb.length(); j++) { p += comb[j]; for(int k = 0; k < comb.length(); k++) { p += comb[k]; if(press(p) == 3) return p; } } } assert(true); }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:22: 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(int i = 0; i < comb.length(); i++) {
      |                    ~~^~~~~~~~~~~~~~~
combo.cpp:10:26: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   10 |         string p = comb[i];
      |                          ^
combo.cpp:11:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |         for(int j = 0; j < comb.length(); j++) {
      |                        ~~^~~~~~~~~~~~~~~
combo.cpp:13:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |             for(int k = 0; k < comb.length(); k++) {
      |                            ~~^~~~~~~~~~~~~~~
combo.cpp:8:19: warning: control reaches end of non-void function [-Wreturn-type]
    8 |     string comb = "AABBXXYY";
      |                   ^~~~~~~~~~