Submission #134220

#TimeUsernameProblemLanguageResultExecution timeMemory
134220redaCombo (IOI18_combo)C++14
30 / 100
58 ms448 KiB
#include<bits/stdc++.h> using namespace std ; #define pb push_back #define ll long long #define ld long double #define mp make_pair #define MOD 1000000007 #define endl '\n' #pragma GCC optimize ("O3") #include "combo.h" string guess_sequence(int N) { char a[] = {'A', 'B', 'Y', 'X'}; char ban = 'X', def = 'A'; string cur; int coins; for(int i = 0; i < 3; i++) if(press(string(1, a[i]))) { ban = a[i]; def = a[(i+1)%4]; break; } cur = ban; char c; for(int k = 2; k <= N; k++) { c = def; for(int i = 0; i < 4; i++) { if(a[i] == ban || a[i] == def) continue; if(press(cur+a[i]) == k) { c = a[i]; break; } } cur += c; } return cur; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:7: warning: unused variable 'coins' [-Wunused-variable]
   16 |   int coins;
      |       ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...