QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#874635 | #2742. Combo | Alimkhan# | 0 | 1ms | 3840kb | C++23 | 1.3kb | 2025-01-28 12:43:16 | 2025-01-28 12:43:27 |
Judging History
answer
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
char a[10], cnt;
char f;
vector <char> v;
char findfirst() {
string s;
s = a[1];
int x = press(s);
if (x == 1) {
return a[1];
}
s = a[2];
x = press(s);
if (x == 1) {
return a[2];
}
s = a[3];
x = press(s);
if (x == 1) {
return a[3];
}
return a[4];
}
std::string guess_sequence(int N) {
int n = N;
a[1] = 'A';
a[2] = 'B';
a[3] = 'X';
a[4] = 'Y';
f = findfirst();
string s = to_string(f);
cnt = 1;
for (int i = 1; i <= n; i++) {
if (a[i] != f) {
v.push_back(a[i]);
}
}
while(s.size() + 1 < n) {
string s1 = s;
string s2 = s;
string s3 = s;
string s4 = s;
string q;
s1 += v[0];
s2 += v[0];
s3 += v[0];
s1 += v[0];
s2 += v[1];
s3 += v[2];
s4 += v[1];
q += s1;
q += s2;
q += s3;
q += s4;
int x = press(q);
if (x == cnt + 2) {
s += v[0];
cnt = x;
continue;
}
if (x == cnt + 1) {
s += v[1];
cnt = x;
continue;
}
s += v[2];
cnt = x + 1;
}
string s1 = s;
string s2 = s;
string s3 = s;
s1 += v[0];
s2 += v[1];
s3 += v[2];
int x = press(s1);
if (x == n) {
return s1;
}
x = press(s2);
if (x == n) {
return s2;
}
return s3;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3840kb
input:
ABB
output:
Wrong Answer: invalid press
result:
wrong answer
Subtask #2:
score: 0
Runtime Error
Test #37:
score: 0
Runtime Error
input:
A
output:
Unauthorized output