Submission #547002

#TimeUsernameProblemLanguageResultExecution timeMemory
547002beedleCombo (IOI18_combo)C++17
10 / 100
70 ms448 KiB
#include <iostream> #include <iomanip> #include <vector> #include <algorithm> #include <set> #include <iterator> #include <stack> #include <map> #include <math.h> #include <bitset> #include <deque> #include <string> #include <tuple> #include <queue> #include <numeric> #include <unordered_set> #include <unordered_map> #define pi 3.141592653589793238 #define ll long long #define ld long double #define rep(i, a, b) for (long long i = a; i <= b; i++) #define mod 1000000007ll #define INF 1000000000000000000 #define pb push_back #define ff first #define ss second #define endl '\n' #define all(x) (x).begin (), (x).end () #define sz(x) (ll) (x).size () #define reunique(v) v.resize(std::unique(v.begin(), v.end()) - v.begin()) #define rank rnk #define log lg #define fast \ ios_base::sync_with_stdio (false); \ cin.tie (NULL); \ cout.tie (NULL) using namespace std; int press(string p); string guess_sequence(int n) { string ans=""; vector <char> pos={'A','B','X','Y'}; for(auto c:pos) { string q=""; q.pb(c); int x=press(q); if(x==1) { ans.pb(c); break; } } while(sz(ans)!=n) { for(auto c:pos) if(c!=ans[0]) { string q=ans; q.pb(c); int x=press(q); if(x==sz(ans)+1) { ans.pb(c); break; } } } return ans; } // signed main() // { // fast; // freopen("milkorder.in","r",stdin); // freopen("milkorder.out","w",stdout); // guess_sequence(5); // return 0; // }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...