제출 #331235

#제출 시각아이디문제언어결과실행 시간메모리
331235PetiPassword (RMI18_password)C++14
50 / 100
452 ms656 KiB
#include <iostream> #include <vector> using namespace std; int query(string str); string guess(int n, int s){ vector<int> db(26, 0); for(int i = 0; i < s; i++){ char c = (char)((int)'a' + i); string q; q.assign(n, c); db[i] = query(q); } string pass; pass.assign(db[0], 'a'); for(int i = 1; i < s; i++){ char c = (char)((int)('a' + i)); int x = 0; for(int j = 0; j < db[i]; j++){ while(1){ string q = pass; q.insert(q.begin() + x, c); if(query(q) == (int)q.size()){ pass = q; break; } x++; } } } return pass; }
#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...