Submission #666313

#TimeUsernameProblemLanguageResultExecution timeMemory
666313NursikPassword (RMI18_password)C++14
30 / 100
402 ms336 KiB
#include <stdio.h> #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; #define ll long long #define pb push_back int ix[30], adx[10000], lst[10000]; char y[10000]; int query(string str); string guess(int n, int s){ string ans = ""; int mx = 0, c = -1; for (int i = 0; i < s; ++i){ string kek = ""; char ch = 'a'; ch += i; for (int j = 1; j <= n; ++j){ kek += ch; } ix[i] = query(kek); if (ix[i] > mx){ mx = ix[i]; c = i; } } for (int j = 1; j <= mx; ++j){ char ch = 'a'; ch += c; ans += ch; } ix[c] = 0; for (int i = 0; i < s; ++i){ if (ix[i] == 0){ continue; } char ch = 'a'; ch += i; string nans = ""; for (int j = 0; j < n; ++j){ if (j < (int)ans.size()){ y[j] = ans[j]; } else{ y[j] = ch; } } for (int j = (int)ans.size(); j >= 0; --j){ string q = ""; for (int k = 0; k < n; ++k){ if (k < j){ q += ans[k]; } else{ q += ch; } } int kek = query(q); kek -= j; adx[j] = kek - lst[j + 1]; lst[j] = lst[j + 1] + adx[j]; } for (int j = 0; j <= (int)ans.size(); ++j){ while (adx[j] > 0){ nans += ch; adx[j] -= 1; } if (j < (int)ans.size()){ nans += ans[j]; } } for (int j = 0; j < n; ++j){ lst[j] = 0, adx[j] = 0; } ans = nans; } return ans; }
#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...