Submission #1066427

#TimeUsernameProblemLanguageResultExecution timeMemory
1066427guanexCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; typedef pair<int, int> ii; typedef long long ll; typedef vector<ll> vll; typedef pair<long long, long long> pll; typedef pair<char, int> ci; typedef pair<string, int> si; typedef long double ld; typedef vector<int> vi; typedef vector<string> vs; #define pb push_back #define fi first #define se second #define whole(v) v.begin(), v.end() #define rwhole(v) v.rbegin(), v.rend() #define inf INT_MAX/2 #define fro front std::string guess_sequence(int N) { string s; char fi; int c = press("A"); if(c){ fi = 'A'; }else{ c = press("B"); if(c){ fi = 'B'; }else{ c = press("X"); if(c){ fi = 'X'; }else{ fi = 'Y'; } } } char x = 'Y'; if(fi == 'Y'){ x = 'X'; } char y = 'B'; if(fi == 'B'){ y = 'X'; } char z = 'A'; if(fi == 'A'){ z = 'X'; } s.pb(fi); int lc = 1; for(int i = 0; i < N; ++i){ c = press(y); if(c){ s.pb(y); }else{ c = press(z); if(c){ s.pb(z); }else{ s.pb(x); } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:58:19: error: could not convert 'y' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   58 |         c = press(y);
      |                   ^
      |                   |
      |                   char
combo.cpp:62:23: error: could not convert 'z' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   62 |             c = press(z);
      |                       ^
      |                       |
      |                       char
combo.cpp:56:9: warning: unused variable 'lc' [-Wunused-variable]
   56 |     int lc = 1;
      |         ^~