Submission #164348

#TimeUsernameProblemLanguageResultExecution timeMemory
164348aggu_01000101Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
//#include"combo.h" //#include<bits/stdc++.h> #include <iostream> #include <string> #include <vector> using namespace std; string guess_sequence(int n){ string lol[] = {"A", "B", "X", "Y"}; vector<string> t; int taken = 0; while(press(lol[taken])==0) taken++; for(int i = 0;i<4;i++){ if(i==taken) continue; t.push_back(lol[i]); } string s = lol[taken]; for(int i = 1;i<(n-1);i++){ int loll = press(s + t[0] + s + t[1] + t[0] + s + t[1] + t[2] + s + s[1][1]); if(lol1==0){ s+=t[2]; } else if(lol1==(i+1)){ s+=t[0]; } else{ s+=t[1]; } } if(n==1) return s; taken = 0; while(press(s+lol[taken])==0) taken++; s+=lol[taken]; return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:11: error: 'press' was not declared in this scope
   12 |     while(press(lol[taken])==0) taken++;
      |           ^~~~~
combo.cpp:19:81: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}[int]' for array subscript
   19 |         int loll = press(s + t[0] + s + t[1] + t[0] + s + t[1] + t[2] + s + s[1][1]);
      |                                                                                 ^
combo.cpp:19:20: error: 'press' was not declared in this scope
   19 |         int loll = press(s + t[0] + s + t[1] + t[0] + s + t[1] + t[2] + s + s[1][1]);
      |                    ^~~~~
combo.cpp:20:12: error: 'lol1' was not declared in this scope; did you mean 'loll'?
   20 |         if(lol1==0){
      |            ^~~~
      |            loll
combo.cpp:19:13: warning: unused variable 'loll' [-Wunused-variable]
   19 |         int loll = press(s + t[0] + s + t[1] + t[0] + s + t[1] + t[2] + s + s[1][1]);
      |             ^~~~
combo.cpp:32:11: error: 'press' was not declared in this scope
   32 |     while(press(s+lol[taken])==0) taken++;
      |           ^~~~~