제출 #1295448

#제출 시각아이디문제언어결과실행 시간메모리
1295448jahongirPassword (RMI18_password)C++20
30 / 100
141 ms440 KiB
#include <bits/stdc++.h> using namespace std; int query(string s); string guess(int n, int s){ string tmp = "a"; int m = tmp.size(); while(m <= n){ bool st = 0; for(int i = 0; i < s; i++){ tmp[m-1] = char(i+'a'); if(query(tmp)==m){ st = 1; break; } } if(!st) break; tmp += 'a'; m++; } tmp.pop_back(); m--; for(int i = m-1; i >= 0 && m<n; ){ bool st = 0; tmp.insert(tmp.begin()+i,'a'); i++,m++; for(int j = 0; j < s; j++){ tmp[i-1] = char(j+'a'); if(query(tmp)==m){ st = 1; break; } } if(st==0){ m--, i-=2; tmp.erase(tmp.begin()+i+1); } } return tmp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...