제출 #261478

#제출 시각아이디문제언어결과실행 시간메모리
261478Valera_Grinenko콤보 (IOI18_combo)C++17
5 / 100
1 ms212 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 x = 0; if(press("AB")) if(press("A")) ans = "A"; else { ans = "B"; x = 1; } else if(press("X")) { ans = "X"; x = 2; } else { ans = "Y"; x = 3; } char ask[4] = {'A', 'B', 'X', 'Y'}; swap(ask[3], ask[x]); 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; } /* */

컴파일 시 표준 에러 (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...