제출 #1012365

#제출 시각아이디문제언어결과실행 시간메모리
1012365MahmytM콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #include "combo.h" using namespace std; #define ll long long #define ff first #define ss second #define pb push_back #define yes cout<<"YES"<<endl #define no cout<<"NO"<<endl string guess_sequence(int n){ char z[5]; z[1]='A'; z[2]='B'; z[3]='X'; z[4]='Y'; for(int i=1;i<=n;i++){ ans+='#'; } while(true){ for(int j=1;j<=4;j++){ if(z[j]==ans[0] and ans.size()!=0){ continue; } int in=press(ans); if(in==n){ return ans; } for(int i=in;i<n;i++){ ans[i]=z[j]; } } } }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |   ans+='#';
      |   ^~~
      |   abs
combo.cpp:21:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   21 |    if(z[j]==ans[0] and ans.size()!=0){
      |             ^~~
      |             abs
combo.cpp:24:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |    int in=press(ans);
      |                 ^~~
      |                 abs