# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
709205 | 2023-03-13T08:15:07 Z | beepbeepsheep | Password (RMI18_password) | C++17 | 808 ms | 21440 KB |
#include <bits/stdc++.h> using namespace std; int arr[26]; int query(string s); string build(string s, char c, int pos){ string ret=""; for (int i=0;i<pos;i++){ ret+=s[i]; } ret+=c; for (int i=pos;i<s.size();i++){ ret+=s[i]; } return ret; } string mrg(string a, string b){ if (a.size()>b.size()) swap(a,b); if (a=="") return b; string ans=b; int l=0,r=ans.size()+1,m; for (int i=0;i<a.size();i++){ l=0,r=ans.size()+1; for (int m=0;m<=r;m++){ string test=build(ans,a[i],m); int res=query(test); if (res==test.length()){ ans=build(ans,a[i],m); break; } cerr<<ans<<endl; } } return ans; } string dup(char c, int n){ string ret=""; for (int i=0;i<n;i++) ret+=c; return ret; } string guess(int n, int s){ for (int i=0;i<s;i++){ arr[i]=query(dup(i+'a',n)); } string ans=""; for (int i=0;i<s;i++){ ans=mrg(ans,dup(i+'a',arr[i])); } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 75 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 188 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 312 KB | Guessed the password with 759 queries. |
2 | Correct | 9 ms | 336 KB | Guessed the password with 716 queries. |
3 | Correct | 15 ms | 336 KB | Guessed the password with 993 queries. |
4 | Correct | 38 ms | 328 KB | Guessed the password with 2092 queries. |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 808 ms | 21440 KB | Could not guess the password with 50000 queries. |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 75 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 188 queries. |
3 | Correct | 12 ms | 312 KB | Guessed the password with 759 queries. |
4 | Correct | 9 ms | 336 KB | Guessed the password with 716 queries. |
5 | Correct | 15 ms | 336 KB | Guessed the password with 993 queries. |
6 | Correct | 38 ms | 328 KB | Guessed the password with 2092 queries. |
7 | Incorrect | 808 ms | 21440 KB | Could not guess the password with 50000 queries. |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 75 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 188 queries. |
3 | Correct | 12 ms | 312 KB | Guessed the password with 759 queries. |
4 | Correct | 9 ms | 336 KB | Guessed the password with 716 queries. |
5 | Correct | 15 ms | 336 KB | Guessed the password with 993 queries. |
6 | Correct | 38 ms | 328 KB | Guessed the password with 2092 queries. |
7 | Incorrect | 808 ms | 21440 KB | Could not guess the password with 50000 queries. |
8 | Halted | 0 ms | 0 KB | - |