# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
286956 | 2020-08-31T07:52:53 Z | crossing0ver | Password (RMI18_password) | C++17 | 473 ms | 376 KB |
#include<bits/stdc++.h> #define ll long long #define pb push_back #define pii pair<int,int> #define vi vector<int> #define fi first #define se second #define all(x) (x).begin(),(x).end() using namespace std; int m; string suf,pref; int query(string str); mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); string guess(int n, int s) { string pref,P; vector<char> D; for (char i = 'a'; i < 'a' + s ; i++) D.pb(i); for (int i = 1; i <= n; i++) { int len = suf.size() + pref.size(); char LAST = ((int)pref.size() ? pref.back() : 'a'); int cur = len; for (int z = 1; z + pref.size() + suf.size() <= n;) { bool flag = 0; shuffle(D.begin(),D.end(),rng); for (char c : D) { P = pref + c; P += suf; int F = query(P); if (F > cur) { LAST = c; pref += c; cur = F; flag = 1; break; } } if (flag == 0) break; } reverse(all(suf)); if (pref.size()) suf+=pref.back(); reverse(all(suf)); if (pref.size()) pref.pop_back(); if (pref.size() + suf.size() == n) { pref += suf; int Z = query(pref); return pref; } } return suf; } /* main() { ios::sync_with_stdio(0); cin.tie(0); }*/
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Guessed the password with 288 queries. |
2 | Correct | 7 ms | 256 KB | Guessed the password with 705 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 256 KB | Guessed the password with 154 queries. |
2 | Correct | 4 ms | 256 KB | Guessed the password with 308 queries. |
3 | Correct | 3 ms | 256 KB | Guessed the password with 215 queries. |
4 | Correct | 6 ms | 256 KB | Guessed the password with 585 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 178 ms | 376 KB | Guessed the password with 16646 queries. |
2 | Correct | 257 ms | 376 KB | Guessed the password with 27740 queries. |
3 | Correct | 346 ms | 376 KB | Guessed the password with 39034 queries. |
4 | Incorrect | 473 ms | 376 KB | Could not guess the password with 50000 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Guessed the password with 288 queries. |
2 | Correct | 7 ms | 256 KB | Guessed the password with 705 queries. |
3 | Correct | 3 ms | 256 KB | Guessed the password with 154 queries. |
4 | Correct | 4 ms | 256 KB | Guessed the password with 308 queries. |
5 | Correct | 3 ms | 256 KB | Guessed the password with 215 queries. |
6 | Correct | 6 ms | 256 KB | Guessed the password with 585 queries. |
7 | Correct | 178 ms | 376 KB | Guessed the password with 16646 queries. |
8 | Correct | 257 ms | 376 KB | Guessed the password with 27740 queries. |
9 | Correct | 346 ms | 376 KB | Guessed the password with 39034 queries. |
10 | Incorrect | 473 ms | 376 KB | Could not guess the password with 50000 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 256 KB | Guessed the password with 288 queries. |
2 | Correct | 7 ms | 256 KB | Guessed the password with 705 queries. |
3 | Correct | 3 ms | 256 KB | Guessed the password with 154 queries. |
4 | Correct | 4 ms | 256 KB | Guessed the password with 308 queries. |
5 | Correct | 3 ms | 256 KB | Guessed the password with 215 queries. |
6 | Correct | 6 ms | 256 KB | Guessed the password with 585 queries. |
7 | Correct | 178 ms | 376 KB | Guessed the password with 16646 queries. |
8 | Correct | 257 ms | 376 KB | Guessed the password with 27740 queries. |
9 | Correct | 346 ms | 376 KB | Guessed the password with 39034 queries. |
10 | Incorrect | 473 ms | 376 KB | Could not guess the password with 50000 queries. |