Submission #986827

#TimeUsernameProblemLanguageResultExecution timeMemory
986827TsaganaCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include "combo.h" #include<bits/stdc++.h> #define all(x) x.begin(), x.end() #define pq priority_queue #define lb lower_bound #define ub upper_bound #define pb push_back #define eb emplace_back #define F first #define S second using namespace std; char ch(char c) { if (c == 'A') return 'B'; if (c == 'B') return 'X'; if (c == 'X') return 'Y'; if (c == 'Y') return 'A'; } string guess_sequence(int N) { string p = ""; string s = ""; int leng = 0; int coin = 0; char c = 'A'; while (leng < N) { p = s; for (int i = leng; i < N; i++) { p += c; } coin = press(p); if (coin > leng) for (; leng < coin; lenf++) s += c; else c = ch(c); } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:34:42: error: 'lenf' was not declared in this scope; did you mean 'leng'?
   34 |     if (coin > leng) for (; leng < coin; lenf++) s += c;
      |                                          ^~~~
      |                                          leng
combo.cpp:11:11: error: 'second' was not declared in this scope
   11 | #define S second
      |           ^~~~~~
combo.cpp:38:10: note: in expansion of macro 'S'
   38 |   return S;
      |          ^
combo.cpp: In function 'char ch(char)':
combo.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^