Submission #261474

#TimeUsernameProblemLanguageResultExecution timeMemory
261474jairRS콤보 (IOI18_combo)C++17
5 / 100
1 ms280 KiB
#include <iostream>
#include "combo.h"
using namespace std;

string buttons[4] ={ "A", "B", "X", "Y" };

std::string guess_sequence(int N) {
	for (int i = 0; i < 4; i++)
	{
		for (int j = 0; j < 4; j++)
		{
			for (int k = 0; k < 4; k++)
			{
				string test = buttons[i] + buttons[j] + buttons[k];
				int coins = press(test);
				if (coins == N) {
					return test;
				}
			}
		}
	}
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...