# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
848783 | 2023-09-13T13:40:10 Z | TahirAliyev | Password (RMI18_password) | C++17 | 305 ms | 1476 KB |
#include <bits/stdc++.h> using namespace std; int query(string str); vector<string> v; string merge(string a, string b){ int p1 = 0, p2 = 0; while(p1 <= a.size() && p2 < b.size()){ string q = a; q.insert(q.begin() + p1, b[p2]); if(query(q) == q.size()){ a = q; p2++; } else{ p1++; } } return a; } string guess(int n, int s){ for(char c = 'a'; c <= 'a' + s - 1; c++){ string s = ""; for(int i = 1; i <= n; i++){ s += c; } int cnt = query(s); s = ""; for(int i = 1; i <= cnt; i++){ s += c; } v.push_back(s); } string main = v[0]; for(int i = 1; i < v.size(); i++){ main = merge(main, v[i]); } return main; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 596 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 436 KB | Guessed the password with 187 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Guessed the password with 73 queries. |
2 | Correct | 1 ms | 344 KB | Guessed the password with 135 queries. |
3 | Correct | 1 ms | 344 KB | Guessed the password with 93 queries. |
4 | Correct | 1 ms | 432 KB | Guessed the password with 306 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 956 KB | Guessed the password with 5492 queries. |
2 | Correct | 50 ms | 1476 KB | Guessed the password with 11382 queries. |
3 | Correct | 70 ms | 964 KB | Guessed the password with 14049 queries. |
4 | Correct | 109 ms | 956 KB | Guessed the password with 22311 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 596 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 436 KB | Guessed the password with 187 queries. |
3 | Correct | 1 ms | 344 KB | Guessed the password with 73 queries. |
4 | Correct | 1 ms | 344 KB | Guessed the password with 135 queries. |
5 | Correct | 1 ms | 344 KB | Guessed the password with 93 queries. |
6 | Correct | 1 ms | 432 KB | Guessed the password with 306 queries. |
7 | Correct | 28 ms | 956 KB | Guessed the password with 5492 queries. |
8 | Correct | 50 ms | 1476 KB | Guessed the password with 11382 queries. |
9 | Correct | 70 ms | 964 KB | Guessed the password with 14049 queries. |
10 | Correct | 109 ms | 956 KB | Guessed the password with 22311 queries. |
11 | Incorrect | 305 ms | 960 KB | Could not guess the password with 50000 queries. |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 596 KB | Guessed the password with 76 queries. |
2 | Correct | 1 ms | 436 KB | Guessed the password with 187 queries. |
3 | Correct | 1 ms | 344 KB | Guessed the password with 73 queries. |
4 | Correct | 1 ms | 344 KB | Guessed the password with 135 queries. |
5 | Correct | 1 ms | 344 KB | Guessed the password with 93 queries. |
6 | Correct | 1 ms | 432 KB | Guessed the password with 306 queries. |
7 | Correct | 28 ms | 956 KB | Guessed the password with 5492 queries. |
8 | Correct | 50 ms | 1476 KB | Guessed the password with 11382 queries. |
9 | Correct | 70 ms | 964 KB | Guessed the password with 14049 queries. |
10 | Correct | 109 ms | 956 KB | Guessed the password with 22311 queries. |
11 | Incorrect | 305 ms | 960 KB | Could not guess the password with 50000 queries. |
12 | Halted | 0 ms | 0 KB | - |