Submission #261472

#TimeUsernameProblemLanguageResultExecution timeMemory
261472Valera_GrinenkoCombo (IOI18_combo)C++17
5 / 100
1 ms328 KiB
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #include "combo.h" #include <iostream> #include <fstream> #include <algorithm> #include <vector> #include <set> #include <stack> #include <map> #include <iomanip> #include <cmath> #include <queue> #include <bitset> #include <numeric> #include <array> #include <cstring> #include <random> #include <chrono> #define fi first #define se second #define pb push_back #define mp make_pair #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define make_unique(x) sort(all((x))); (x).resize(unique(all((x))) - (x).begin()) typedef long long ll; typedef long double ld; using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); string guess_sequence(int n) { string ans; int st = press("XY"); if(st) if(press("X")) ans = "X"; else ans = "Y"; else if(press("A")) ans = "A"; else ans = "B"; vector<char> ask(4); ask[0] = 'A'; ask[1] = 'B'; ask[2] = 'X'; ask[3] = 'Y'; ask.erase(find(all(ask), ans[0])); for(int i = 1; i < n - 1; i++) { string query = ans + ask[0] + ans + ask[1] + ask[0] + ans + ask[1] + ask[1] + ans + ask[1] + ask[2]; int c = press(query); if(c == i) ans += ask[2]; else if(c == i + 1) ans += ask[0]; else ans += ask[1]; } if(press(ans + ask[0] + ans + ask[1]) == n) if(press(ans + ask[0]) == n) ans += ask[0]; else ans += ask[1]; else ans += ask[2]; return ans; } /* */

Compilation message (stderr)

combo.cpp:3: warning: ignoring '#pragma GCC optimization' [-Wunknown-pragmas]
    3 | #pragma GCC optimization ("unroll-loops")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...