QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#875478#8726. Magic Showbillf0 0ms1792kbC++201.9kb2025-01-29 20:39:412025-01-29 20:39:42

Judging History

This is the latest submission verdict.

  • [2025-01-29 20:39:42]
  • Judged
  • Verdict: 0
  • Time: 0ms
  • Memory: 1792kb
  • [2025-01-29 20:39:41]
  • Submitted

Alice

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
#define fr first
#define sc second
mt19937 rd(time(0));
LL setN(int x);
vector<PII> Alice()
{
    vector<PII> e;
    vector<int> poi[100];
    LL x = setN(5000);
    for (int i = 2; i <= 5000; i++)
    {
        int id = i % 61;
        if (poi[id].size() <= 1)
            e.push_back({1, i});
        poi[id].push_back(i);
    }
    for (int i = 60; ~i; i--)
    {
        int ln = poi[i].size();
        if (x >> i & 1)
        {
            for (int j = 2; j < ln; j++)
            {
                int num, to;
                num = (j + 1) / 2;
                to = 2 * (rd() % num) + 1;
                e.push_back({poi[i][j - to], poi[i][j]});
            }
        }
        else
        {
            for (int j = 2; j < ln; j++)
            {
                int num, to;
                num = j / 2;
                to = 2 * (rd() % num);
                e.push_back({poi[i][j - to], poi[i][j]});
            }
        }
    }
    return e;
}

Bob

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
mt19937 rd(time(0));
LL Bob(vector<PII> e)
{
    vector<int> poi[100];
    int fth[5005] = {0};
    LL res = 0;
    for (int i = 2; i <= 5000; i++)
    {
        int id = i % 61;
        poi[id].push_back(i);
    }
    for (auto [x, y] : e)
        fth[y] = x;
    for (int i = 60; ~i; i--)
    {
        int ln = poi[i].size();
        for (int j = 2; j < ln; j++)
        {
            int num = fth[poi[i][j]];
            if (!num)
                continue;
            auto it = lower_bound(poi[i].begin(), poi[i].end(), num);
            int dis = j - distance(poi[i].begin(), it);
            if (dis & 1)
                res += 1ll << i;
            break;
        }
    }
    return res;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1792kb,1664kb

input:

1
4005

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

Subtask #2:

score: 0
Wrong Answer

Test #13:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1792kb,1664kb

input:

1
17476204

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

Subtask #3:

score: 0
Wrong Answer

Test #25:

score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1792kb,1664kb

input:

1
355365355024496523

output:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

input:

a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022
1
5000
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 ...

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

input:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.

output:

9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4
Output of encode is not a tree.