# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
709089 | 2023-03-13T06:09:56 Z | jamezzz | Password (RMI18_password) | C++17 | 89 ms | 480 KB |
#include <bits/stdc++.h> using namespace std; mt19937 rng(time(0)); int query(string str); string guess(int n,int s){ string ans=""; int pv=0; vector<int> v; for(int i=0;i<s;++i)v.push_back(i); shuffle(v.begin(),v.end(),rng); for(int i:v){ char c='a'+i; for(int j=0;j<ans.length();++j){ string tmp=ans; tmp.insert(j,1,c); int res=query(tmp); if(res>pv){ pv=res; swap(tmp,ans); tmp.clear(); if(pv==n)return ans; continue; } else tmp.clear(); } string tmp=ans; tmp.insert(tmp.length(),n-tmp.length(),c); pv=query(tmp); tmp.resize(pv); swap(ans,tmp); tmp.clear(); if(pv==n)return ans; } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 208 KB | Guessed the password with 128 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 294 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 208 KB | Guessed the password with 48 queries. |
2 | Correct | 2 ms | 208 KB | Guessed the password with 127 queries. |
3 | Correct | 1 ms | 208 KB | Guessed the password with 169 queries. |
4 | Correct | 3 ms | 208 KB | Guessed the password with 234 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 52 ms | 328 KB | Guessed the password with 7478 queries. |
2 | Runtime error | 89 ms | 480 KB | Execution killed with signal 13 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 208 KB | Guessed the password with 128 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 294 queries. |
3 | Correct | 1 ms | 208 KB | Guessed the password with 48 queries. |
4 | Correct | 2 ms | 208 KB | Guessed the password with 127 queries. |
5 | Correct | 1 ms | 208 KB | Guessed the password with 169 queries. |
6 | Correct | 3 ms | 208 KB | Guessed the password with 234 queries. |
7 | Correct | 52 ms | 328 KB | Guessed the password with 7478 queries. |
8 | Runtime error | 89 ms | 480 KB | Execution killed with signal 13 |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 208 KB | Guessed the password with 128 queries. |
2 | Correct | 3 ms | 208 KB | Guessed the password with 294 queries. |
3 | Correct | 1 ms | 208 KB | Guessed the password with 48 queries. |
4 | Correct | 2 ms | 208 KB | Guessed the password with 127 queries. |
5 | Correct | 1 ms | 208 KB | Guessed the password with 169 queries. |
6 | Correct | 3 ms | 208 KB | Guessed the password with 234 queries. |
7 | Correct | 52 ms | 328 KB | Guessed the password with 7478 queries. |
8 | Runtime error | 89 ms | 480 KB | Execution killed with signal 13 |
9 | Halted | 0 ms | 0 KB | - |