QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#607384 | #5560. Hardcore Hangman | whale_island# | WA | 5ms | 5200kb | C++20 | 3.6kb | 2024-10-03 14:49:52 | 2024-10-03 14:49:56 |
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; i++){
for(int j = 0; j < x/2; j++){
s.insert('a' + i+j);
}
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 <= 1000; 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(1005,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 <= 1000; 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;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 5200kb
input:
6 1 2 3 4 5 6 4 1 2 4 6 4 1 2 4 6
output:
? abcdefghijklmnop ? abcdefghrstuvwxy ? abcdjklmstuv ?
result:
wrong answer invalid output