제출 #1104006

#제출 시각아이디문제언어결과실행 시간메모리
1104006asdfghjk콤보 (IOI18_combo)C++17
0 / 100
1 ms336 KiB
#include <bits/stdc++.h> #define ll long long #define pb push_back #define all(x) x.begin(), x.end() #define F first #define ld long double #define S second using namespace std; const ll N = 5e3 + 5; const ll NN = 4e5 + 5; const ll INF = 1e18; const ll inf = 1e9; const ll MOD = 1e9 + 7; char a[10]; int was[10]; int press(std::string p); string guess_sequence(int n){ a[1] = 'A'; a[2] = 'B'; a[3] = 'X'; a[4] = 'Y'; string s = ""; s = "ABX"; int val = press(s); if(press("ABX")==0)s = "Y"; else if(press("ABY") == 0)s = "X"; else if(press("AXY") == 0)s = "B"; else s = "A"; for(int i = 2;i <= n;i++){ if(int(s.size()) > i)continue; string d = s; d += a[1]; d += a[2]; int res = press(d); int sz= int(s.size()); if(res == sz){ s += a[3]; } else if(res == sz + 1){ d = s; d += a[1]; res = press(d); if(res == sz + 1){ s = d; } else{ s += a[2]; } } else{ s = d; } } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:24:9: warning: unused variable 'val' [-Wunused-variable]
   24 |     int val = press(s);
      |         ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...