제출 #254521

#제출 시각아이디문제언어결과실행 시간메모리
254521Erkhemkhuu콤보 (IOI18_combo)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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];