제출 #788126

#제출 시각아이디문제언어결과실행 시간메모리
788126APROHACK콤보 (IOI18_combo)C++17
30 / 100
37 ms456 KiB
#include <bits/stdc++.h> #include "combo.h" #define ll long long #define ff first #define ss second #define pb push_back using namespace std; std::string guess_sequence(int N) { string p = ""; string posi = "ABXY"; string ans = ""; char comienza; string newPosi = ""; int best = 0, res = 0; for(int j = 0 ; j < 3 ; j ++){ p = ans; p+= posi[j]; int coin = press(p); if(coin > res){ res = coin; best = j; } } if(res == 0)best = 3; ans += posi[best]; for(auto i : posi)if(i != posi[best])newPosi += i; //for (auto i : newPosi)cout << i << endl; for(int i = 1 ; i < N ; i ++){ best = 0, res = 0; for(int j = 0 ; j < 2 ; j ++){ p = ans; p+= newPosi[j]; int coin = press(p); if(coin > res){ res = coin; best = j; if(res == i + 1)break; } } if(res != i + 1){ best = 2; } ans += newPosi[best]; } //cout << ans << endl; return ans; }

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:8: warning: unused variable 'comienza' [-Wunused-variable]
   16 |   char comienza;
      |        ^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...