제출 #156649

#제출 시각아이디문제언어결과실행 시간메모리
156649killB0x콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
using namespace std;
#include <bits/stdc++.h>
#include "combo.h"
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> dl;
typedef vector<ii> vii;
typedef vector<dl> vdll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
#define pb push_back
#define mp make_pair
#define ft first
#define sc second
#define in insert
#define bs binary_search
#define rc(s) return cout << s,0
const ll mod=1e9+7;
const int N=100005;
#define INF LLONG_MAX
#define sz(x) ((int)(x.size()))
#define int ll
#define endl '\n'
/*----------------------------*/
char ch[4]={"A","B","X","Y"};
string guess_sequence(int n)
{
    char x;
    string tmp;
    for(int i=0;i<4;i++)
    {
        x=ch[i];;
        if(press(x)==1)
        {
            tmp+=x;
            break;
        }
    }
    for(int i=1;i<n;i++)
    {
        for(int j=0;j<4;j++)
        {
            if(ch[j]!=x)
            {
                if(press(tmp+ch[j])==i+1)
                {
                    tmp+=ch[j];
                    break;
                }
            }
        }
    }
    return tmp;
}
/*----------------------------*/
int32_t main() {
    //freopen("sol.in","r",stdin);
    //freopen("sol.out","w",stdout);
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    //THIS IS IS THE END    
}

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp:27:28: error: too many initializers for 'char [4]'
   27 | char ch[4]={"A","B","X","Y"};
      |                            ^
combo.cpp: In function 'std::string guess_sequence(ll)':
combo.cpp:35:18: error: could not convert 'x' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   35 |         if(press(x)==1)
      |                  ^
      |                  |
      |                  char