Submission #1043865

#TimeUsernameProblemLanguageResultExecution timeMemory
1043865Melanie_MenjivarCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" // abreviaciones de datos y funciones de ellas #define ll long long #define st string #define p pair #define f first #define s second #define v vector #define pb push_back #define vll vector <long long> #define vst vector<string> #define vpll vector <pair<ll,ll>> #define vvll v<vll> #define as assign #define pll pair<ll,ll> #define matrizll v<vll> #define matrizch v<v<char>> #define itrll vll::iterator #define itrst vst::iterator #define itrpll vpll::iterator #define all(x) x.begin(),x.end() #define pq priority_queue #define pq_ll pq <ll> #define pq_st pq <st> #define pq_pll pq<pll> // abreviaciones funciones de impresion #define espa ' ' #define en '\n' #define coutv(a) for(auto x:a){cout<<x<<en;} #define yes cout<<"YES"<<endl #define no cout<<"NO"<<endl //funciones comunes #define rep(i,a,b) for(ll i=a;i<b;i++) #define repm(i,a) for(ll i=a;i>=0;i--) #define test(t) while(t--) #define sort(a) sort(a.begin(),a.end()) #define reverse(a) reverse(a.begin(),a.end()); using namespace std; std::string guess_sequence(int N) { st S,pasado; int consu; string letras[3]; rep(i,0,n){ if(i==0){ consu=press("AB"); if(consu==0){ if(press("X")==0){ S+="Y"; letras[0]="A";letras[1]="B";letras[2]="X"; }else{ S+="X"; letras[0]="A";letras[1]="B";letras[2]="Y"; } }else if(consu==1){ if(press("A")==1){ S+="A"; letras[0]="B";letras[1]="X";letras[2]="Y"; }else { S+="B"; letras[0]="A";letras[1]="X";letras[2]="Y"; } }else{ S+="A" letras[0]="B";letras[1]="X";letras[2]="Y"; } }else if(i==n-1){ consu=press(letras[0]); if(consu==0){ if(press(letras[1])==0){ S+=letras[2]; }else{ S+=letras[1]; } }else{ S+=letras[0]; } }else{ consu=press(S+letras[0]+S+letras[1]+letras[0]+S+letras[1]+letras[1]+S+letras[1]+letras[2]) if(consu==S.size()+1){ S+=letras[0]; }else if(consu==S.size()+2){ S+=letras[1]; }else{ S+=letras[2]; } } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:49:11: error: 'n' was not declared in this scope
   49 |   rep(i,0,n){
      |           ^
combo.cpp:37:33: note: in definition of macro 'rep'
   37 | #define rep(i,a,b) for(ll i=a;i<b;i++)
      |                                 ^
combo.cpp:72:15: error: expected ';' before 'letras'
   72 |         S+="A"
      |               ^
      |               ;
   73 | 
   74 |         letras[0]="B";letras[1]="X";letras[2]="Y";
      |         ~~~~~~ 
combo.cpp:92:97: error: expected ';' before 'if'
   92 |       consu=press(S+letras[0]+S+letras[1]+letras[0]+S+letras[1]+letras[1]+S+letras[1]+letras[2])
      |                                                                                                 ^
      |                                                                                                 ;
   93 | 
   94 |       if(consu==S.size()+1){
      |       ~~                                                                                         
combo.cpp:96:8: error: 'else' without a previous 'if'
   96 |       }else if(consu==S.size()+2){
      |        ^~~~
combo.cpp:96:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   96 |       }else if(consu==S.size()+2){
      |                ~~~~~^~~~~~~~~~~~