Submission #464414

#TimeUsernameProblemLanguageResultExecution timeMemory
464414fuad27Password (RMI18_password)C++14
30 / 100
451 ms276 KiB
#include<bits/stdc++.h> // #include"grader.cpp" using namespace std; typedef long long ll; typedef long double ld; #define vii vector<pair<int, int>> #define vi vector<int> #define vl vector<long long> #define vll vector<pair<long long, long long>> #define mp make_pair #define pb push_back #define rep(i, a, b) for(int i = a;i<=b;i++) #define f first #define s second #define FIO ios_base::sync_with_stdio(0);cin.tie(0); #define start int tt;cin>>tt;rep(testcase, 1, tt) #define print(k) cout<<"Case #"<<testcase<<": "<<k<<"\n"; #define endl "\n" int query(string s); string guess(int n,int s){ string ans = ""; for(int i=0;i<n;i++){ bool check = false; for(int c=0;c<s;c++){ char ch = 'a'+c; int pref = query((ch+ans)); if(pref == i+1){ ans = ch+ans; check = true; break; } } if(check)continue; for(int j=0;j<i;j++){ for(int c=0;c<s;c++){ char ch = 'a'+c; string tmp = ans.substr(0,j+1)+ch+ans.substr(j+1,n-j-1); int pref = query((tmp)); if(pref == i+1){ ans = tmp; check = true; break; } } if(check)break; } } 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...