제출 #421476

#제출 시각아이디문제언어결과실행 시간메모리
421476Keshi콤보 (IOI18_combo)C++17
5 / 100
1 ms200 KiB
//In the name of God #include<bits/stdc++.h> #include "combo.h" using namespace std; typedef int ll; typedef pair<ll, ll> pll; const ll maxn = 2e5 + 100; const ll mod = 1e9 + 7; const ll inf = 1e9; #define fast_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define pb push_back #define Mp make_pair #define F first #define S second #define Sz(x) ll((x).size()) #define all(x) (x).begin(), (x).end() string c = "ABXY", ch; string guess_sequence(int n){ string s, t; ll x = press("AB"); if(x == 0){ x = press("X"); if(x) s += 'X'; else s += 'Y'; } else{ x = press("A"); if(x) s += 'A'; else s += 'B'; } for(ll i = 0; i < 4; i++){ if(c[i] != s[0]) ch += c[i]; } for(ll i = 1; i < n - 1; i++){ t = s; t += ch[0]; for(ll j = 0; j < 3; j++){ t += s + ch[1] + ch[j]; } x = press(t); if(x == i) s += ch[2]; else if(x == i + 1){ s += ch[0]; assert(press(s) == i + 1); } else if(x == i + 2) s += ch[1]; else{ cout << 1 / 0; return s; } } t = s + ch[0]; x = press(t); if(x == n) s += ch[0]; else{ t = s + ch[1]; x = press(t); if(x == n) s += ch[1]; else s += ch[2]; } return s; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:53:14: warning: division by zero [-Wdiv-by-zero]
   53 |    cout << 1 / 0;
      |            ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...