답안 #926482

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
926482 2024-02-13T05:54:31 Z Tuanlinh123 Broken Device (JOI17_broken_device) C++17
8 / 100
38 ms 3192 KB
#include "Annalib.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
using namespace std;

void Anna(int n, long long x, int k, int p[])
{
    pair<ll, bitset<150>> bs[60];
    vector <ll> val={888, 3561928307572012, 360526174126927439, 364998058823035, 40208, 31, 783, 65, 72444455486084455, 55389839735, 28112, 122, 828543276859, 192161796431007, 33663460, 12, 1886, 17291061348, 115896509, 5672, 827768, 7, 3501, 425035105159319, 154106415, 24215589121, 200377, 52461053117, 3558164, 1, 29656002, 6709760, 7, 1476444367238303, 673771881, 185663142, 1351747, 225026, 442, 11909, 4370, 58028959, 495, 53514944, 75856675614, 100205, 9, 1670334446, 160590842847497088, 35, 750124542857317568, 25405648386920, 16384196534, 4155863, 28, 539667638601, 1591730731836546, 294454, 11756, 15109223186428496, 233, 1369, 438425981, 58901664394626, 18409295, 55005832768869617, 8660, 7413060718, 1907203480686, 13, 3096, 53707, 48312084672979313, 1947, 23028529, 24948262536753004, 54894538340672, 2759, 48276, 107399950, 1227774513, 3, 1, 324, 273663, 132180314277924642, 7206637596738981, 8924499422733, 3, 84778, 4565069431030, 16928092852614, 126006807038600, 810, 919795843066339, 201451578679998, 7463791110, 13078757, 11948745, 3926895, 11545832278192836, 1420433, 3, 104, 2030659, 8063827, 211, 1, 633539539738971825, 51, 20600049720956854, 776226332163, 2546736684, 98216485873, 15155008233, 281669373094, 7, 770754, 267960765164534038, 42, 408464518, 71021963459679, 2699937007363484, 114512, 103490077, 143, 28827445813174, 5890472998375, 167305874, 735427, 25823, 6837751, 8938214, 3975274293818, 1063400751542217, 3511299535823, 300846, 215808544953, 170231146440, 615729526, 1135254621449, 514941354187006727, 6140005601605743, 977918616, 24859, 4237, 2389681659, 517658586, 26, 138548};
    for (ll i=n-1, ptr=k-1; i>=0; i--)
    {
        while (ptr>=0 && p[ptr]==i)
            i--, ptr--;
        if (i<0) break;
        bitset <150> cr; cr.reset(); cr[i]=1;
        for (ll j=59; j>=0; j--)
            if (val[i]&1ll<<j)
            {
                if (bs[j].fi) val[i]^=bs[j].fi, cr^=bs[j].se;
                else {bs[j]={val[i], cr}; break;}
            }
    }
    bitset <150> cr; cr.reset();
    for (ll i=59; i>=0; i--)
        if (x&1ll<<i)
            x^=bs[i].fi, cr^=bs[i].se;
    for (ll i=0; i<n; i++) Set(i, cr[i]);
}
#include "Brunolib.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
using namespace std;

long long Bruno(int n, int A[])
{
    vector <ll> val={888, 3561928307572012, 360526174126927439, 364998058823035, 40208, 31, 783, 65, 72444455486084455, 55389839735, 28112, 122, 828543276859, 192161796431007, 33663460, 12, 1886, 17291061348, 115896509, 5672, 827768, 7, 3501, 425035105159319, 154106415, 24215589121, 200377, 52461053117, 3558164, 1, 29656002, 6709760, 7, 1476444367238303, 673771881, 185663142, 1351747, 225026, 442, 11909, 4370, 58028959, 495, 53514944, 75856675614, 100205, 9, 1670334446, 160590842847497088, 35, 750124542857317568, 25405648386920, 16384196534, 4155863, 28, 539667638601, 1591730731836546, 294454, 11756, 15109223186428496, 233, 1369, 438425981, 58901664394626, 18409295, 55005832768869617, 8660, 7413060718, 1907203480686, 13, 3096, 53707, 48312084672979313, 1947, 23028529, 24948262536753004, 54894538340672, 2759, 48276, 107399950, 1227774513, 3, 1, 324, 273663, 132180314277924642, 7206637596738981, 8924499422733, 3, 84778, 4565069431030, 16928092852614, 126006807038600, 810, 919795843066339, 201451578679998, 7463791110, 13078757, 11948745, 3926895, 11545832278192836, 1420433, 3, 104, 2030659, 8063827, 211, 1, 633539539738971825, 51, 20600049720956854, 776226332163, 2546736684, 98216485873, 15155008233, 281669373094, 7, 770754, 267960765164534038, 42, 408464518, 71021963459679, 2699937007363484, 114512, 103490077, 143, 28827445813174, 5890472998375, 167305874, 735427, 25823, 6837751, 8938214, 3975274293818, 1063400751542217, 3511299535823, 300846, 215808544953, 170231146440, 615729526, 1135254621449, 514941354187006727, 6140005601605743, 977918616, 24859, 4237, 2389681659, 517658586, 26, 138548};
    ll ans=0;
    for (ll i=0; i<n; i++)
        if (A[i]) ans^=val[i];
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 33 ms 2776 KB Output is partially correct - L* = 26
2 Partially correct 35 ms 2748 KB Output is partially correct - L* = 16
3 Partially correct 33 ms 2744 KB Output is partially correct - L* = 32
4 Partially correct 33 ms 2772 KB Output is partially correct - L* = 19
5 Partially correct 34 ms 2752 KB Output is partially correct - L* = 30
6 Partially correct 34 ms 2828 KB Output is partially correct - L* = 20
7 Partially correct 38 ms 2828 KB Output is partially correct - L* = 26
8 Partially correct 33 ms 3192 KB Output is partially correct - L* = 19
9 Partially correct 34 ms 2712 KB Output is partially correct - L* = 26
10 Partially correct 34 ms 2764 KB Output is partially correct - L* = 28
11 Partially correct 34 ms 2776 KB Output is partially correct - L* = 21
12 Partially correct 33 ms 2776 KB Output is partially correct - L* = 18
13 Partially correct 33 ms 2752 KB Output is partially correct - L* = 28
14 Partially correct 38 ms 2728 KB Output is partially correct - L* = 14
15 Partially correct 34 ms 2680 KB Output is partially correct - L* = 21
16 Partially correct 34 ms 2860 KB Output is partially correct - L* = 14
17 Partially correct 33 ms 2808 KB Output is partially correct - L* = 37
18 Partially correct 34 ms 2748 KB Output is partially correct - L* = 34
19 Partially correct 33 ms 2676 KB Output is partially correct - L* = 29
20 Partially correct 34 ms 2780 KB Output is partially correct - L* = 19
21 Partially correct 36 ms 2748 KB Output is partially correct - L* = 18
22 Partially correct 33 ms 2680 KB Output is partially correct - L* = 18
23 Partially correct 34 ms 2812 KB Output is partially correct - L* = 35
24 Partially correct 33 ms 2684 KB Output is partially correct - L* = 21
25 Partially correct 33 ms 2748 KB Output is partially correct - L* = 28
26 Partially correct 34 ms 2752 KB Output is partially correct - L* = 16
27 Partially correct 33 ms 2836 KB Output is partially correct - L* = 23
28 Partially correct 33 ms 2616 KB Output is partially correct - L* = 17
29 Partially correct 34 ms 2736 KB Output is partially correct - L* = 23
30 Partially correct 35 ms 2856 KB Output is partially correct - L* = 24
31 Partially correct 33 ms 2584 KB Output is partially correct - L* = 16
32 Partially correct 35 ms 2968 KB Output is partially correct - L* = 18
33 Partially correct 33 ms 2760 KB Output is partially correct - L* = 15
34 Partially correct 34 ms 2780 KB Output is partially correct - L* = 20
35 Partially correct 34 ms 2816 KB Output is partially correct - L* = 22
36 Partially correct 34 ms 2820 KB Output is partially correct - L* = 24
37 Partially correct 34 ms 2792 KB Output is partially correct - L* = 16
38 Partially correct 34 ms 2892 KB Output is partially correct - L* = 22
39 Partially correct 38 ms 2860 KB Output is partially correct - L* = 23
40 Partially correct 32 ms 2776 KB Output is partially correct - L* = 17