Submission #552313

#TimeUsernameProblemLanguageResultExecution timeMemory
552313tmpCombo (IOI18_combo)C++14
5 / 100
1 ms208 KiB
#include<bits/stdc++.h> #define maxn 10005 #define oo 1000000007 #define ff first #define ss second #define sci(x) scanf("%d", &x) #define scii(x, y) scanf("%d %d", &x, &y) #define fto(i, a, b) for(int i = a; i <= b; ++i) #define fdto(i, a, b) for(int i = a; i >= b; --i) #define pri(x) printf("%d ", x); #define pril(x) printf("%d\n", x); #define sz(a) (int)a.size() #define ii pair<int, int> #define vi vector<int> #define vii vector<ii> #define pb push_back #define ll long long #define db double #define mp make_pair #define fast cin.sync_with_stdio(0); cin.tie(0) using namespace std; //int press(string p); int press(string p); // cout << p << endl; // int x; // cin >> x; // return x; //} string guess_sequence(int n) { string p = ""; vector<char> e, tmp; e.pb('A'); e.pb('B'); e.pb('X'); e.pb('Y'); char check; int coins = 0; fto(i, 0, 2){ if (press(p+e[i])){ coins = 1; p += e[i]; check = e[i]; break; } } if (coins == 0){ coins = 1; check = e[3]; p += e[3]; } for (int j = 0; j < sz(e); ++j){ if (check == e[j]) continue; else tmp.pb(e[j]); } while(1){ bool dk = 0; for (int x = 1; x < sz(tmp); ++x){ if (check == tmp[x]) continue; if (press(p+tmp[x]) > coins){ ++coins; p += tmp[x]; dk = 1; break; } } if (dk == 0 && check != tmp[0]){ p += tmp[0]; ++coins; } if (coins == n) return p; } return p; } //int main(){ // int n; // cin >> n; // cout << guess_sequence(n) << endl; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...