Submission #254521

#TimeUsernameProblemLanguageResultExecution timeMemory
254521ErkhemkhuuCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include <combo.h>
using namespace std;
#define ll long long
#define pb push_back
#define mk make_pair
#define F first
#define S second
string guess_sequence(int n) {
    string res = "";
    vector <char> vc = {'A', 'B', 'X', 'Y'};
    for(int i = 0; i < vc.size(); i++)
        for(int j = 0; j < vc.size(); j++)
            for(int k = 0; k < vc.size(); k++) {
                string temp = vc[i] + vc[j] + vc[k];
                if(press(temp) == 3)
                    res = temp;
            }
    return res;
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for(int i = 0; i < vc.size(); i++)
      |                    ~~^~~~~~~~~~~
combo.cpp:13:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |         for(int j = 0; j < vc.size(); j++)
      |                        ~~^~~~~~~~~~~
combo.cpp:14:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |             for(int k = 0; k < vc.size(); k++) {
      |                            ~~^~~~~~~~~~~
combo.cpp:15:45: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   15 |                 string temp = vc[i] + vc[j] + vc[k];