QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#607480 | #5560. Hardcore Hangman | whale_island# | WA | 36ms | 19072kb | C++20 | 3.6kb | 2024-10-03 15:00:58 | 2024-10-03 15:00:58 |
Judging History
answer
// __________________
// | ________________ |
// || ____ ||
// || /\ | ||
// || /__\ | ||
// || / \ |____ ||
// ||________________||
// |__________________|
// \###################\
// \###################\
// \ ____ \
// \_______\___\_______\
// An AC a day keeps the doctor away.
//#pragma GCC optimize("O3,unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
#define hutao_my_wife ios_base::sync_with_stdio(0);
#define forcalors_so_cute cin.tie(0);
/*
struct A {
public: [[nodiscard]] virtual const unsigned long long reference operator bitor (const unsigned long long reference a) const noexcept;
};
struct B: public A{
public: [[nodiscard]] virtual const unsigned long long reference operator bitor (const unsigned long long reference a) const noexcept override final {
}
};
inline char readchar() noexcept {
static char buffer[BUFSIZ], * now = buffer + BUFSIZ, * end = buffer + BUFSIZ;
if (now == end)
{
if (end < buffer + BUFSIZ)
return EOF;
end = (buffer + fread(buffer, 1, BUFSIZ, stdin));
now = buffer;
}
return *now++;
}
inline int nextint() noexcept {
int x = 0, c = readchar(), neg = 0;
while(('0' > c || c > '9') && c!='-' && c!=EOF) c = readchar();
if(c == '-') neg = true, c = readchar();
while('0' <= c && c <= '9') x = (x<<3) + (x<<1) + (c^'0'), c = readchar();
if(neg) x = -x;
return x; // returns 0 if EOF
}
//fast io cin>>a 改成 a = nextint();
*/
#define ll long long
//#define int long long
#define pii pair<int,int>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define ALL(v) v.begin(), v.end()
#define bug(A) cout<<A<<" hi\n";
using namespace std;
const ll M = 200005;
set<char> deal(int x){
set<char> s;
for(int i = 0; i < 32;){
for(int j = 0; j < x/2 && i+j <32; j++){
s.insert('a' + i+j);
// cout<<i <<' '<<j<<'\n';
}
i+=x;
}
return s;
}
set<int>st[32][2];
void solve(){
int now = 32, pos = 0;
for(int i = 0; i < 32; i++){
for(int j = 1; j <= 10000; j++)
st[i][1].insert(j);
}
while(now>1){
for(int i = 0; i < 32; i++)st[i][pos].clear();
set<char>tmp = deal(now);
set<int>r;
cout<<"? ";
for(auto i:tmp){
if(i < 'a' + 26)
cout<<i;
}
cout<<endl;
int n;
cin>>n;
for(int i = 0; i < n; i++){
int c;
cin>>c;
r.insert(c);
}
for(int i = 0; i < 32; i++){
if(tmp.count(i+'a')){
for(char it:st[i][(pos^1)]){
if(r.count(it))st[i][pos].insert(it);
}
}
else{
for(char it:st[i][(pos^1)]){
if(!r.count(it))st[i][pos].insert(it);
}
}
}
//for(auto it:st[0][0])cout<<it<<' ';cout<<endl;
pos^=1;
now/=2;
}
vector<char>ans(10005,0);
pos^=1;
for(int i = 0; i < 26; i++){
for(auto it:st[i][pos]){
//cout<<(char)('a' + i)<<' ' <<it<<'\n';
ans[it] = 'a' + i;
}
}
cout<<"! ";
for(int i = 1; i <= 10004; i++){
if(ans[i] == 0)break;
cout<<ans[i];
}
cout<<endl;
}
signed main(){
//
hutao_my_wife forcalors_so_cute
int t = 1;
//cin>>t;
while(t--){
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 31ms
memory: 18820kb
input:
6 1 2 3 4 5 6 4 1 2 4 6 4 1 2 4 6 6 1 2 3 4 5 6 3 2 4 6 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! banana
result:
ok Queries used: 6
Test #2:
score: 0
Accepted
time: 30ms
memory: 18780kb
input:
10 1 2 3 4 5 7 9 11 12 13 9 1 2 4 6 7 8 9 10 13 6 2 4 5 6 7 10 5 5 7 9 12 13 12 1 2 4 5 6 7 8 9 10 11 12 13 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! gcpcisawesome
result:
ok Queries used: 6
Test #3:
score: 0
Accepted
time: 29ms
memory: 18804kb
input:
20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! aaaaaaaaaaaaaaaaaaaa
result:
ok Queries used: 6
Test #4:
score: 0
Accepted
time: 34ms
memory: 19032kb
input:
10 1 3 5 7 9 11 13 15 17 19 10 1 3 5 7 9 11 13 15 17 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 10 1 3 5 7 9 11 13 15 17 19 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! azazazazazazazazazaz
result:
ok Queries used: 6
Test #5:
score: 0
Accepted
time: 30ms
memory: 18776kb
input:
16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 1 2 3 4 5 6 7 8 17 18 19 20 21 22 23 24 14 1 2 3 4 9 10 11 12 17 18 19 20 25 26 14 1 2 5 6 9 10 13 14 17 18 21 22 25 26 13 1 3 5 7 9 11 13 15 17 19 21 23 25 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! abcdefghijklmnopqrstuvwxyz
result:
ok Queries used: 6
Test #6:
score: 0
Accepted
time: 32ms
memory: 18872kb
input:
0 0 1 1 1 1 0 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! z
result:
ok Queries used: 6
Test #7:
score: 0
Accepted
time: 31ms
memory: 18832kb
input:
1 1 0 0 1 1 1 1 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! m
result:
ok Queries used: 6
Test #8:
score: 0
Accepted
time: 31ms
memory: 18872kb
input:
6 1 2 3 5 6 9 9 1 4 5 6 7 8 9 10 11 6 1 4 7 8 10 11 5 1 2 6 7 9 5 1 3 6 9 10 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! anothertest
result:
ok Queries used: 6
Test #9:
score: 0
Accepted
time: 33ms
memory: 18772kb
input:
14 1 2 3 5 7 8 9 11 12 13 14 16 17 19 13 2 4 6 9 10 11 13 15 16 18 19 20 21 11 5 6 7 9 10 13 16 17 18 20 21 13 2 3 4 7 8 9 11 12 13 14 15 16 19 12 2 4 7 8 9 11 12 13 15 16 19 20 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! penultimatemanualtest
result:
ok Queries used: 6
Test #10:
score: 0
Accepted
time: 36ms
memory: 18768kb
input:
10 1 2 5 6 7 9 10 11 12 13 8 2 3 4 6 8 9 14 15 9 1 2 3 4 6 9 10 11 15 9 2 5 6 7 8 9 11 12 14 8 2 3 5 6 8 9 11 14 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! lastmanualinput
result:
ok Queries used: 6
Test #11:
score: 0
Accepted
time: 33ms
memory: 19072kb
input:
14 1 3 5 7 8 9 11 12 13 14 17 18 24 25 15 1 2 4 5 6 7 10 13 16 19 21 22 23 24 25 13 2 3 4 9 10 12 14 15 17 18 19 20 24 16 1 2 3 6 9 11 12 13 14 15 16 20 21 22 24 25 11 3 5 7 9 10 11 14 15 19 21 22 correct
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! fritgvgpismjfiyvllszuuxbf
result:
ok Queries used: 6
Test #12:
score: 0
Accepted
time: 31ms
memory: 18768kb
input:
29 1 3 4 5 8 9 10 12 13 15 17 18 20 22 24 25 26 27 28 29 31 33 38 40 43 44 46 49 50 32 2 5 6 8 9 11 12 13 14 15 17 18 21 22 23 24 25 26 30 33 34 37 39 40 41 43 44 45 46 47 48 49 30 2 4 5 7 8 15 16 19 20 22 25 26 27 28 29 31 32 33 35 36 37 39 40 41 42 44 45 47 49 50 28 1 2 3 5 6 7 13 14 16 19 23 24 2...
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! mrnlbuychoxhevcyhgzlxcufcakkiwkzcvzyqmqarzfcsetvbk
result:
ok Queries used: 6
Test #13:
score: 0
Accepted
time: 32ms
memory: 18784kb
input:
47 1 2 4 5 6 7 9 15 18 20 22 25 28 30 31 32 33 34 35 37 38 41 42 43 44 45 46 48 49 52 53 54 55 56 57 58 59 61 62 63 65 68 69 70 72 73 74 50 1 2 5 6 7 8 9 11 12 13 14 15 16 17 19 20 21 25 26 27 28 32 36 37 38 39 40 41 44 45 47 48 49 50 51 52 54 56 58 59 60 61 63 64 65 67 69 71 72 75 43 1 3 5 7 8 9 10...
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! dezmaeasbzuvvtgvxjvhwkzybwtfylibpolsagqtbjkfaotfeuxejalhidcxaihubyqlepvhiir
result:
ok Queries used: 6
Test #14:
score: 0
Accepted
time: 34ms
memory: 18840kb
input:
58 1 6 8 10 12 13 15 16 17 20 24 25 26 27 29 30 31 33 35 36 38 40 41 42 44 46 48 53 55 56 58 61 63 64 66 67 68 69 70 71 72 73 74 76 77 82 83 84 85 86 87 89 90 91 93 97 99 100 57 3 5 6 9 10 11 14 15 16 17 18 19 20 21 22 25 28 30 31 32 33 34 37 39 41 43 45 46 48 49 50 52 54 57 59 60 62 63 64 65 66 67 ...
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! oyqzweymwfvjmxccdxxgrvymdkkslecsgukovlqjhiulshzctvzxiqloxpwrnwaeqhamdpimfozikttuqnaneolvhmjyjtyvhwep
result:
ok Queries used: 6
Test #15:
score: -100
Wrong Answer
time: 30ms
memory: 18784kb
input:
161 3 4 6 7 8 9 10 11 12 13 15 17 20 22 25 26 27 28 30 31 32 33 34 35 36 38 41 42 43 44 46 49 50 54 57 59 60 61 62 63 64 65 66 67 68 69 71 72 73 74 75 77 78 79 80 81 82 85 86 88 89 93 94 95 96 97 98 99 100 103 105 106 107 108 109 110 112 114 116 120 121 122 123 124 127 128 129 131 133 134 136 140 14...
output:
? abcdefghijklmnop ? abcdefghqrstuvwx ? abcdijklqrstyz ? abefijmnqruvyz ? acegikmoqsuwy ! tsffrakjgcenatgvlqtouarwhobkundgpbbfrprrlmgdulrtadyzrossatofomlamkokernfdlprdiahhiqscdspmwuwadeeomijxtdvfnfdjbtfwhweuuukmfhauvh
result:
wrong answer format Unexpected end of file - token expected