Submission #986847

#TimeUsernameProblemLanguageResultExecution timeMemory
986847LucaIlieCombo (IOI18_combo)C++17
30 / 100
21 ms1472 KiB
#include "combo.h" #include <iostream> using namespace std; char ch[4] = {'A', 'B', 'X', 'Y' }; char alf[3]; string s; string guess_sequence( int n ) { int coins, i, first_letter = -1, j, verific; for( i = 0; i < 3; i++ ) { s = ch[i]; if( press(s) == 1 ) first_letter = i; } if( first_letter == -1 ) first_letter = 3; s = ch[first_letter]; //cout << s; j = 0; for( i = 0; i < 4; i++ ) { if( i != first_letter ) { alf[j] = ch[i]; j++; } } for( i = 1; i < n; i++ ) { for( j = 0; j < 3; j++ ) { if( j == 2 ) { s = s + alf[j]; //cout << alf[j]; } else if( press( s + alf[j] ) == i + 1 ) { s = s + alf[j]; //cout << alf[j]; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:10:9: warning: unused variable 'coins' [-Wunused-variable]
   10 |     int coins, i, first_letter = -1, j, verific;
      |         ^~~~~
combo.cpp:10:41: warning: unused variable 'verific' [-Wunused-variable]
   10 |     int coins, i, first_letter = -1, j, verific;
      |                                         ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...