Submission #772314

#TimeUsernameProblemLanguageResultExecution timeMemory
772314tolbiCombo (IOI18_combo)C++17
100 / 100
28 ms552 KiB
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz!.. //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan //Sani buyuk Osman Pasa Plevneden cikmam diyor #define author tolbi #include <bits/stdc++.h> using namespace std; template<typename X, typename Y> istream& operator>>(istream& is, pair<X,Y> &pr){return is>>pr.first>>pr.second;} template<typename X, size_t Y> istream& operator>>(istream& is, array<X,Y> arr){for (auto &it : arr) is>>it; return is;} template<typename T> istream& operator>>(istream& is, vector<T> arr){for (auto &it : arr) is>>it; return is;} #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define endl '\n' #define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); #define vint(x) vector<int> x #define cinarr(x) for(auto &it : x) cin>>it; #define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl; #define sortarr(x) sort(x.begin(), x.end()) #define sortrarr(x) sort(x.rbegin(), x.rend()) #define rev(x) reverse(x.begin(), x.end()) #define tol(bi) (1LL<<((int)(bi))) mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #include "combo.h" string guess_sequence(int N){ if (N==1){ if (press("A")) return "A"; else if (press("B")) return "B"; else if (press("X")) return "X"; else return "Y"; } vector<char> mv; string fs=""; if (press("AB")){ if (press("AXAYAB")==2) fs.push_back('A'); else fs.push_back('B'); } else { if (press("XAXBXY")==2) fs.push_back('X'); else fs.push_back('Y'); } if (fs[0]!='A') mv.push_back('A'); if (fs[0]!='B') mv.push_back('B'); if (fs[0]!='X') mv.push_back('X'); if (fs[0]!='Y') mv.push_back('Y'); for (int ch = 2; ch <= N; ch++){ if (ch==N){ if (press(fs+mv[0])==ch) fs+=mv[0]; else if (press(fs+mv[1])==ch) fs+=mv[1]; else fs+=mv[2]; } else { int kk = press(fs+mv[0]+mv[0]+fs+mv[0]+mv[1]+fs+mv[0]+mv[2]+fs+mv[1]); if (kk==ch) fs+=mv[1]; else if (kk==ch+1) fs+=mv[0]; else fs+=mv[2]; } } return fs; }

Compilation message (stderr)

combo.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...