QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#572582#5560. Hardcore HangmanV-ioleTTL 0ms0kbC++201.4kb2024-09-18 15:27:062024-09-18 15:27:07

Judging History

你现在查看的是最新测评结果

  • [2024-09-18 15:27:07]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-09-18 15:27:06]
  • 提交

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

input:


output:


result: