Submission #61192857


Source Code Expand

Copy
/*
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
I'm in my prime and this ain't even final form
They knocked me down, but still, my feet, they find the floor
I went from living rooms straight out to sold-out tours
Life's a fight, but trust, I'm ready for the war
Woah-oh-oh
This is how the story goes
Woah-oh-oh
I guess this is how the story goes
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
From the screen to the ring, to the pen, to the king
Where's my crown? That's my bling
Always drama when I ring
See, I believe that if I see it in my heart
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
/*
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
I'm in my prime and this ain't even final form
They knocked me down, but still, my feet, they find the floor
I went from living rooms straight out to sold-out tours
Life's a fight, but trust, I'm ready for the war
Woah-oh-oh
This is how the story goes
Woah-oh-oh
I guess this is how the story goes
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
From the screen to the ring, to the pen, to the king
Where's my crown? That's my bling
Always drama when I ring
See, I believe that if I see it in my heart
Smash through the ceiling 'cause I'm reachin' for the stars
Woah-oh-oh
This is how the story goes
Woah-oh-oh
I guess this is how the story goes
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze (woo)
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
Highway to heaven, I'm just cruisin' by my lone'
They cast me out, left me for dead, them people cold
My faith in God, mind in the sun, I'm 'bout to sow (yeah)
My life is hard, I took the wheel, I cracked the code (yeah-yeah, woah-oh-oh)
Ain't nobody gon' save you, man, this life will break you (yeah, woah-oh-oh)
In the thick of it, this is how the story goes
I'm in the thick of it, everybody knows
They know me where it snows, I skied in and they froze
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told
I'm in the thick of it, everybody knows (everybody knows)
They know me where it snows, I skied in and they froze (yeah)
I don't know no nothin' 'bout no ice, I'm just cold
Forty somethin' milli' subs or so, I've been told (ooh-ooh)
Woah-oh-oh (nah-nah-nah-nah, ayy, ayy)
This is how the story goes (nah, nah)
Woah-oh-oh
I guess this is how the story goes
*/
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define MAXN 200005
#define MAXBITS 60

void solve() {
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    for (ll i = 0; i < n; i++) {
        cin >> a[i];
    }
    
    vector<vector<ll>> dp(n + 1, vector<ll>(k + 1, 0));
    for (ll i = 0; i <= n; i++) {
        dp[i][0] = 0;
    }
    for (ll i = 1; i <= n; i++) {
        for (ll j = 1; j <= k; j++) {
            dp[i][j] = max({dp[i-1][j], dp[i-1][j-1] ^ a[i-1], a[i-1]});
        }
    }

    cout << dp[n][k] << '\n';
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Submission Info

Submission Time
Task E - Maximize XOR
User Jxsh28
Language C++ 17 (gcc 12.2)
Score 0
Code Size 2846 Byte
Status RE
Exec Time 1626 ms
Memory 3628536 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
WA × 2
AC × 3
WA × 42
RE × 3
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt, 01_test_23.txt, 01_test_24.txt, 01_test_25.txt, 01_test_26.txt, 01_test_27.txt, 01_test_28.txt, 01_test_29.txt, 01_test_30.txt, 01_test_31.txt, 01_test_32.txt, 01_test_33.txt, 01_test_34.txt, 01_test_35.txt, 01_test_36.txt, 01_test_37.txt, 01_test_38.txt, 01_test_39.txt, 01_test_40.txt, 01_test_41.txt, 01_test_42.txt, 01_test_43.txt, 01_test_44.txt, 01_test_45.txt
Case Name Status Exec Time Memory
00_sample_00.txt WA 1 ms 3396 KB
00_sample_01.txt WA 1 ms 3468 KB
01_test_00.txt AC 12 ms 8360 KB
01_test_01.txt AC 27 ms 15436 KB
01_test_02.txt RE 1626 ms 3628536 KB
01_test_03.txt RE 1606 ms 3628440 KB
01_test_04.txt WA 30 ms 5540 KB
01_test_05.txt WA 1 ms 3496 KB
01_test_06.txt WA 3 ms 6924 KB
01_test_07.txt WA 9 ms 18884 KB
01_test_08.txt WA 1 ms 3372 KB
01_test_09.txt WA 1 ms 3404 KB
01_test_10.txt WA 1 ms 3372 KB
01_test_11.txt WA 1 ms 3580 KB
01_test_12.txt WA 1 ms 3356 KB
01_test_13.txt WA 1 ms 3304 KB
01_test_14.txt WA 1 ms 3440 KB
01_test_15.txt WA 1 ms 3620 KB
01_test_16.txt WA 1 ms 3388 KB
01_test_17.txt WA 1 ms 3492 KB
01_test_18.txt WA 1 ms 3404 KB
01_test_19.txt WA 1 ms 3448 KB
01_test_20.txt WA 1 ms 3436 KB
01_test_21.txt WA 1 ms 3428 KB
01_test_22.txt WA 1 ms 3496 KB
01_test_23.txt WA 1 ms 3444 KB
01_test_24.txt WA 1 ms 3488 KB
01_test_25.txt WA 1 ms 3448 KB
01_test_26.txt WA 1 ms 3388 KB
01_test_27.txt WA 1 ms 3412 KB
01_test_28.txt WA 1 ms 3376 KB
01_test_29.txt WA 1 ms 3436 KB
01_test_30.txt WA 1 ms 3452 KB
01_test_31.txt WA 1 ms 3400 KB
01_test_32.txt WA 1 ms 3388 KB
01_test_33.txt WA 1 ms 3372 KB
01_test_34.txt WA 1 ms 3572 KB
01_test_35.txt WA 1 ms 3456 KB
01_test_36.txt WA 1 ms 3492 KB
01_test_37.txt WA 1 ms 3456 KB
01_test_38.txt WA 1 ms 3380 KB
01_test_39.txt WA 1 ms 3388 KB
01_test_40.txt WA 1 ms 3380 KB
01_test_41.txt WA 1 ms 3488 KB
01_test_42.txt WA 1 ms 3424 KB
01_test_43.txt WA 1 ms 3500 KB
01_test_44.txt AC 1 ms 3360 KB
01_test_45.txt RE 1529 ms 3628196 KB


2025-03-05 (Wed)
12:22:44 +00:00