Submission #645231

#TimeUsernameProblemLanguageResultExecution timeMemory
645231alexddPassword (RMI18_password)C++17
0 / 100
1 ms208 KiB
#include<iostream> #include<unordered_map> using namespace std; unordered_map<string,int> umap; int query(string str); int intreaba(string str) { if(umap.count(str)==0) umap[str]=query(str); return umap[str]; } string tochar(int ch) { char ceva=ch+'a'; string nush=""; nush=nush+ceva; return nush; } string guess(int n, int s) { umap.clear(); string rez=""; for(int i=1;i<=n;i++) { for(int ch=0;ch<26;ch++) { if(intreaba(rez+tochar(ch))==intreaba(rez)) continue; bool bl=0; for(int bad=0;bad<26;bad++) { if(intreaba(rez+tochar(ch))<intreaba(rez+tochar(bad)+tochar(ch))) { bl=1; break; } } if(bl==1) { rez=rez+tochar(ch); break; } } } return rez; }
#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...