Submission #1141913

#TimeUsernameProblemLanguageResultExecution timeMemory
1141913mehdibaCombo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include "combo.h"
#include <bits/stdc++.h>
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

string guess_sequence(int n){
	string p = "";
	// press(p): gives the amount of coins you get by pressing the string p
    vector<string> pp;
    string tt = "ABXY";
    for(int i = 0; i < n; i++){
        string t;
        t += tt[i];
        for(int j = 0; j < n; j++){
            if(tt[j] == t[0]) continue;
            t += tt[j];
            for(int k = 0; k < n; k++){
                if(tt[k] == t[0]) continue;
                t += tt[k];
                pp.pb(t);
                t.erase(t.end() - 1);
            }
            t.erase(t.end() - 1);
        }
    }
    for(string t : pp) if(press(t) == 3) return t;
}

Compilation message (stderr)

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