Submission #918625

#TimeUsernameProblemLanguageResultExecution timeMemory
918625Elvin_FritlPassword (RMI18_password)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int N=2e3+5, mod=1e9+7; int query(string str); mt19937 rng(time(NULL)); string v , res; int n , s; bool func(int ind , int tr) { if(ind == n) { return true; } bool br = false; for(int j=0;j<s - 1;j++) { res[ind] = v[j]; int tmp = query(res); res[ind] = 'a'; if(tmp == tr + 1) { br = true; res[ind] = v[j]; bool tmm = func(ind + 1 , tr + 1); if(tmm == true) { return true; } res[ind] = 'a'; } } if(br == true) { return false; } return func(ind + 1 , tr); } string guess(int n, int s) { v = ""; for(int i=1;i<s;i++) { v += (char('a' + i)); } shuffle(v.begin() , v.end() , rng); res = ""; for(int i=0;i<n;i++) { res = res + 'a'; } int tr = query(res); bool as = func(0 , tr); return res; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:53:10: warning: unused variable 'as' [-Wunused-variable]
   53 |     bool as = func(0 , tr);
      |          ^~
#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...