# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
333352 | 2020-12-05T16:47:18 Z | valerikk | Password (RMI18_password) | C++17 | 959 ms | 632 KB |
#include <bits/stdc++.h> using namespace std; int query(string str); void myinsert(string &str, int pos, char x) { string s = ""; for (int i = 0; i <= str.size(); i++) { if (i < pos) s.push_back(str[i]); else { if (i == pos) s.push_back(x); else s.push_back(str[i - 1]); } } str = s; } void myerase(string &str, int pos) { string s = ""; for (int i = 0; i < str.size(); i++) { if (i == pos) continue; s.push_back(str[i]); } str = s; } string guess(int n, int s) { string cur = ""; string res = ""; for (int i = 0; i < n; i++) { while (true) { bool was = false; for (char x = 'a'; x < 'a' + s; x++) { if (cur.size() == n) break; myinsert(cur, i, x); if (query(cur) == cur.size()) was = true; else myerase(cur, i); } if (!was) break; } res.push_back(cur[i]); } return res; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 364 KB | Guessed the password with 315 queries. |
2 | Correct | 6 ms | 384 KB | Guessed the password with 712 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 364 KB | Guessed the password with 171 queries. |
2 | Correct | 4 ms | 384 KB | Guessed the password with 364 queries. |
3 | Correct | 10 ms | 364 KB | Guessed the password with 530 queries. |
4 | Correct | 6 ms | 364 KB | Guessed the password with 671 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 297 ms | 492 KB | Guessed the password with 19701 queries. |
2 | Correct | 568 ms | 632 KB | Guessed the password with 33699 queries. |
3 | Correct | 906 ms | 620 KB | Guessed the password with 45557 queries. |
4 | Incorrect | 959 ms | 364 KB | Could not guess the password with 50000 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 364 KB | Guessed the password with 315 queries. |
2 | Correct | 6 ms | 384 KB | Guessed the password with 712 queries. |
3 | Correct | 3 ms | 364 KB | Guessed the password with 171 queries. |
4 | Correct | 4 ms | 384 KB | Guessed the password with 364 queries. |
5 | Correct | 10 ms | 364 KB | Guessed the password with 530 queries. |
6 | Correct | 6 ms | 364 KB | Guessed the password with 671 queries. |
7 | Correct | 297 ms | 492 KB | Guessed the password with 19701 queries. |
8 | Correct | 568 ms | 632 KB | Guessed the password with 33699 queries. |
9 | Correct | 906 ms | 620 KB | Guessed the password with 45557 queries. |
10 | Incorrect | 959 ms | 364 KB | Could not guess the password with 50000 queries. |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 4 ms | 364 KB | Guessed the password with 315 queries. |
2 | Correct | 6 ms | 384 KB | Guessed the password with 712 queries. |
3 | Correct | 3 ms | 364 KB | Guessed the password with 171 queries. |
4 | Correct | 4 ms | 384 KB | Guessed the password with 364 queries. |
5 | Correct | 10 ms | 364 KB | Guessed the password with 530 queries. |
6 | Correct | 6 ms | 364 KB | Guessed the password with 671 queries. |
7 | Correct | 297 ms | 492 KB | Guessed the password with 19701 queries. |
8 | Correct | 568 ms | 632 KB | Guessed the password with 33699 queries. |
9 | Correct | 906 ms | 620 KB | Guessed the password with 45557 queries. |
10 | Incorrect | 959 ms | 364 KB | Could not guess the password with 50000 queries. |