제출 #546521

#제출 시각아이디문제언어결과실행 시간메모리
546521srivatsav_kannan콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <fstream> #include <vector> #include <set> #include <queue> #include <cmath> #include <map> #include <algorithm> #include <numeric> #include <stack> #include <cstring> #include <bitset> #include <climits> #include <valarray> #include <list> #include "combo.h" //#define int long long #define INF 1000000000 #define endl '\n' #define mod 1000000007 using namespace std; string ar[4] = {"A", "B", "X", "Y"}; string guess_sequence(signed n){ string ans; for (int i = 0; i < n; i++){ for (int j = 0; j < 4; j++) { int temp = ans; ans += ar[j]; if (press(temp) == ans.size()) { ans += ar[j]; break; } } } return ans; } //signed main(){ // ios_base::sync_with_stdio(false); // cin.tie(0); // cout.tie(0); // //}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:27:24: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in initialization
   27 |             int temp = ans;
      |                        ^~~
      |                        |
      |                        std::string {aka std::__cxx11::basic_string<char>}
combo.cpp:29:23: error: could not convert 'temp' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   29 |             if (press(temp) == ans.size()) {
      |                       ^~~~
      |                       |
      |                       int