QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#572582 | #5560. Hardcore Hangman | V-ioleT | TL | 0ms | 0kb | C++20 | 1.4kb | 2024-09-18 15:27:06 | 2024-09-18 15:27:07 |
answer
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define endl '\n'
#define int long long
#define ull unsigned long long
typedef long long ll;
#define lowbit(x) ((x) & -(x))
const ll INF = 0x3f3f3f3f;
const ll mod = 9223372034707292160;
const int N = 1e5 + 5, M = 5e5 + 10;
typedef pair<int, int> PII;
double T = 1 >> 30;
// double PI = acos(-1);
int gcd(int a, int b)
{
return b ? gcd(b, a % b) : a;
}
int a[N];
void solve()
{
int i, j;
cout << "? ";
for (char x = 'a'; x <= 'z';x++)
cout << x;
cout << endl;
int n;
cin >> n;
int x;
for (i = 1; i <= n;i++)
{
cin >> x;
}
int t;
for (i = 0; i < 5;i++)
{
cout << "? ";
for (j = 0; j < 26;j++)
{
if(j&(1<<i))
cout << (char)('a' + j);
}
cout << endl;
cin >> t;
for (j = 1; j <= t;j++)
{
cin >> x;
a[x] |= (1 << i);
}
}
cout << "! ";
for (i = 1; i <= n;i++)
{
cout << (char)('a' + a[i]);
}
cout << endl;
}
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int t = 1;
// cin >> t;
while (t--)
{
// Case++;
solve();
}
return 0;
}
詳細信息
Test #1:
score: 0
Time Limit Exceeded