UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#215002#2481. 或STASISZHY0197ms6728kbC++11808b2024-11-25 19:41:262024-11-25 23:05:39

answer

// Problem: C. 或
// Contest: undefined - NOIP2024训练赛 13
// URL: http://noi.ac/contest/1165/problem/2481
// Memory Limit: 1024 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
//#define int long long
#define fi first
#define se second
#define PII pair<int, int>

using namespace std;

const int N = 2e5 + 10, M = 1e6 + 10, mod = 1e9 + 7, INF = 0x3f3f3f3f;

int n, m, q, k, x, ans;
int s[N], dp[N];

vector<int> e[N];

signed main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n >> k >> x;	
	for(int i = 1; i <= n; i ++) cin >> s[i];
	sort(s + 1, s + n + 1); m = s[n];
	for(int i = 1; i <= k; i ++) m = m * x;
	for(int i = 1; i < n; i ++) ans |= s[i];
	ans |= m;
	cout << ans << '\n'; 
	return 0;
}

Details

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 0ms
memory: 5948kb

input:

5 1 7
0 8 1048584 1572872 524296

output:

12058680

result:

ok single line: '12058680'

Test #2:

score: 0
Accepted
time: 0ms
memory: 5960kb

input:

5 1 4
266252 262153 266249 9 262144

output:

1331257

result:

ok single line: '1331257'

Test #3:

score: 0
Accepted
time: 0ms
memory: 5948kb

input:

5 1 3
262280 8388620 42205192 33554440 41943052

output:

126615708

result:

ok single line: '126615708'

Test #4:

score: 0
Accepted
time: 0ms
memory: 5960kb

input:

5 1 5
72353802 340805641 273680394 271583243 69748747

output:

1979279407

result:

ok single line: '1979279407'

Test #5:

score: -10
Wrong Answer
time: 0ms
memory: 5956kb

input:

5 1 6
84165274 556269848 84673192 69222560 69484808

output:

-939767878

result:

wrong answer 1st lines differ - expected: '3355199418', found: '-939767878'

Subtask #2:

score: 0
Wrong Answer

Test #11:

score: 10
Accepted
time: 0ms
memory: 5960kb

input:

5 3 4
4194308 0 4 0 4194304

output:

272630020

result:

ok single line: '272630020'

Test #12:

score: -10
Wrong Answer
time: 3ms
memory: 5960kb

input:

5 2 7
201854976 67108864 144707584 69210112 75501568

output:

1303056384

result:

wrong answer 1st lines differ - expected: '9892990976', found: '1303056384'

Subtask #3:

score: 0
Wrong Answer

Test #21:

score: 0
Wrong Answer
time: 3ms
memory: 5944kb

input:

10 5 3
0 0 32776 8 33587200 33587200 33554432 32768 33554432 32768

output:

-428244984

result:

wrong answer 1st lines differ - expected: '8161689608', found: '-428244984'

Subtask #4:

score: 0
Wrong Answer

Test #31:

score: 10
Accepted
time: 0ms
memory: 5960kb

input:

20 2 7
4 0 16777216 16777220 4 16777220 4 16777216 0 4 16777216 16777220 16777220 4 0 16777220 16777...

output:

822083780

result:

ok single line: '822083780'

Test #32:

score: 0
Accepted
time: 0ms
memory: 5960kb

input:

20 2 7
0 517 4128 37 37 4613 33 549 4129 4100 549 4644 548 4 1 0 4612 4 4129 4612

output:

228069

result:

ok single line: '228069'

Test #33:

score: -10
Wrong Answer
time: 0ms
memory: 5960kb

input:

20 10 7
2097408 280 69206016 8397080 67108864 67117072 8448 77602833 10486033 77594889 75497472 7549...

output:

-2068305127

result:

wrong answer 1st lines differ - expected: '21920879650286361', found: '-2068305127'

Subtask #5:

score: 0
Wrong Answer

Test #41:

score: 0
Wrong Answer
time: 3ms
memory: 5960kb

input:

20 10 5
262144 263168 262144 262144 1024 268435456 262144 1024 262144 262144 262144 0 262144 2686986...

output:

-1055744

result:

wrong answer 1st lines differ - expected: '2624010268435456', found: '-1055744'

Subtask #6:

score: 0
Wrong Answer

Test #51:

score: 0
Wrong Answer
time: 3ms
memory: 5944kb

input:

500 3 6
536879104 536879104 536879104 8 8200 8192 536879104 8 536870920 8192 536879112 536879104 536...

output:

538650312

result:

wrong answer 1st lines differ - expected: '116502767304', found: '538650312'

Subtask #7:

score: 0
Wrong Answer

Test #61:

score: 0
Wrong Answer
time: 4ms
memory: 5972kb

input:

5000 4 6
268435456 0 64 268435520 268435520 66 268435458 268435520 66 2 64 268435456 268435456 64 64...

output:

268521058

result:

wrong answer 1st lines differ - expected: '348160872034', found: '268521058'

Subtask #8:

score: 0
Wrong Answer

Test #71:

score: 10
Accepted
time: 23ms
memory: 6724kb

input:

200000 1 2
136 524288 524296 524416 136 128 524288 128 136 0 136 136 136 0 128 0 524424 0 524416 524...

output:

1573272

result:

ok single line: '1573272'

Test #72:

score: 0
Accepted
time: 23ms
memory: 6724kb

input:

200000 1 3
67108865 16777217 21037056 65537 20971521 1 16842753 16842753 67108865 83951617 65536 209...

output:

264437763

result:

ok single line: '264437763'

Test #73:

score: 0
Accepted
time: 31ms
memory: 6728kb

input:

200000 1 3
134418440 402788392 402718760 196664 135216 134217752 40 402853912 134807608 725000 40285...

output:

1479225528

result:

ok single line: '1479225528'

Test #74:

score: 0
Accepted
time: 28ms
memory: 6724kb

input:

200000 1 2
536871951 33794 537001993 671252488 537001990 131080 134217738 132103 134251523 671089675...

output:

2013760543

result:

ok single line: '2013760543'

Test #75:

score: -10
Wrong Answer
time: 29ms
memory: 6728kb

input:

200000 1 3
796800 2762752 2100640 2229408 158880 2384896 2508960 2884640 3032480 2124192 2386304 402...

output:

11496928

result:

wrong answer 1st lines differ - expected: '11501536', found: '11496928'

Subtask #9:

score: 0
Wrong Answer

Test #81:

score: 0
Wrong Answer
time: 28ms
memory: 6724kb

input:

200000 6 7
67108864 536870912 71303168 67108864 608174080 541065216 67108864 608174080 536870912 536...

output:

1816133632

result:

wrong answer 1st lines differ - expected: '71551676317696', found: '1816133632'

Subtask #10:

score: 0
Wrong Answer

Test #91:

score: 0
Wrong Answer
time: 19ms
memory: 6728kb

input:

200000 7 2
4 67108864 4 67108868 1 1 67108869 0 67108869 67108868 67108864 1 67108864 67108868 67108...

output:

67109509

result:

wrong answer 1st lines differ - expected: '8657044101', found: '67109509'