QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#406867#6661. 야유회tuanlinh1230 0ms0kbC++201.4kb2024-05-07 19:26:142024-05-07 19:26:14

Judging History

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

  • [2024-05-07 19:26:14]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-05-07 19:26:14]
  • 提交

answer

#include "workshop.h"
#include<bits/stdc++.h>
#define ll long long
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ld long double
#define sz(a) ((ll)(a).size())
using namespace std;

const ll maxn=100005;
ll a[maxn], b[maxn], c[maxn];

void init() 
{
    for (ll i=0, cr=0; i<maxn; i++)
    {
        while (__builtin_popcount(cr)!=10) cr++;
        a[i]=cr++;
    }
    for (ll i=0, cr=0; i<20; i++)
    {
        while (__builtin_popcount(cr)!=3) cr++;
        b[i]=cr++;
    }
    for (ll i=0, cr=0; i<6; i++)
    {
        while (__builtin_popcount(cr)!=2) cr++;
        c[i]=cr++;
    }
}

int morning(int my_num, int right_num) 
{ 
    for (ll i=0; i<20; i++)
        if ((a[my_num]&1<<i) && !(a[right_num]&1<<i))
            return b[i];
    assert(0);
}

int merge(int a, int b)
{
    for (ll i=0; i<6; i++)
        if ((a&1<<i) && !(b&1<<i))
            return c[i];
    assert(0);
}

int afternoon(int left_num, int my_num, int right_num) 
{ 
    tie(my_num, right_num)=mp(merge(left_num, my_num), merge(my_num, right_num));
    for (ll i=0; i<4; i++)
        if ((my_num&1<<i) && !(right_num&1<<i))
            return i;
    assert(0);
}

int evening(int left_num, int my_num, int right_num) 
{ 
    if (my_num<3) return my_num;
    for (ll i=0; i<2; i++)
        if (left_num!=i && right_num!=i)
            return i;
    assert(0);
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
1
2
40 40
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
40 40
0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38

output:


result:


Subtask #2:

score: 0
Runtime Error

Test #8:

score: 0
Runtime Error

input:

2dc2b1d4-8de2-INPUT-bcd3-aa55b691fdb3
2
2
40 40
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
40 40
0 3 1 5 7 9 6 4 2 10 8 23 21 25 27 29 26 24 22 30 28 13 11 15 17 19 16 14 12 20 18 33 31 35 37 39 36 34 32 38

output:


result: