Submission #773168

#TimeUsernameProblemLanguageResultExecution timeMemory
773168aykhnPassword (RMI18_password)C++14
0 / 100
5 ms308 KiB
#include <bits/stdc++.h> // author: aykhn using namespace std; typedef long long ll; int query(string str); string guess(int n, int s) { string ans = ""; int prev = 0; string x = "a"; for (int i = 0; i < s; i++) { ans = x + ans; int X = query(ans); prev = max(X, prev); int sz = ans.length(); if (!X) ans = ans.substr(1, sz - 1); for (int j = 1; j <= ans.length(); j++) { string asdasdasd = ans; string asd = ans.substr(0, j); string assd = ""; int sz = ans.length(); if (j != sz) assd = ans.substr(j, sz - j); ans = asd; ans += x; ans += assd; int y = query(ans); if (y <= prev) { ans = asdasdasd; } else prev = y; } x[0]++; } return ans; }

Compilation message (stderr)

password.cpp: In function 'std::string guess(int, int)':
password.cpp:25:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         for (int j = 1; j <= ans.length(); j++)
      |                         ~~^~~~~~~~~~~~~~~
#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...