UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#215339#2713. 8.2t2a_sad_soul0215ms3268kbC++11589b2024-11-28 19:26:222024-11-28 23:10:57

answer

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+10;
int cnt[MAXN];
int a[MAXN];
int b[MAXN];
int n,m;
typedef pair<int,int>arr;
priority_queue<arr>q;
int main(){
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;++i){
		scanf("%d",&a[i]);
		q.push(arr(a[i],i));
	}
	for(int i=1;i<=n;++i)scanf("%d",&b[i]);
	int ans=0;
	while(m--&&!q.empty()){
		arr x=q.top();q.pop();
		ans^=x.first;
		cnt[x.second]++;
		if(cnt[x.second]==1)q.push(arr(b[x.second],x.second));
		else if(cnt[x.second]==2)q.push(arr(a[x.second],x.second));
	}
	cout<<ans<<endl;
	return 0;
}

Details

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

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

4 10
2 2 4 8
8 4 7 10

output:

11

result:

wrong answer 1st numbers differ - expected: '2', found: '11'

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 1252kb

input:

5 10
51072389 300657765 633439665 787090487 68456665
196385267 67864372 385977125 213928095 324494080

output:

427625695

result:

wrong answer 1st numbers differ - expected: '3719844854', found: '427625695'

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 1256kb

input:

5 10
48720179 139181569 338164905 149648143 77222193
187724219 91625887 540142777 43334953 184586388

output:

648812221

result:

wrong answer 1st numbers differ - expected: '215635088', found: '648812221'

Test #4:

score: 0
Wrong Answer
time: 26ms
memory: 3268kb

input:

100000 102662
33421051 125633985 365251021 255717315 262377226 360896081 5951202 90071401 154444767 ...

output:

52937703

result:

wrong answer 1st numbers differ - expected: '69628185742891', found: '52937703'

Test #5:

score: 0
Wrong Answer
time: 38ms
memory: 3268kb

input:

100000 102838
588484254 69882126 151341881 500364775 68104321 134809939 50886121 98623841 274710921 ...

output:

621353959

result:

wrong answer 1st numbers differ - expected: '2211168290969', found: '621353959'

Test #6:

score: 0
Wrong Answer
time: 40ms
memory: 3268kb

input:

100000 102858
816229225 31491762 141788824 11587861 40202296 167103151 76959748 111706177 185028195 ...

output:

341064873

result:

wrong answer 1st numbers differ - expected: '6040329651388', found: '341064873'

Test #7:

score: 0
Wrong Answer
time: 18ms
memory: 3132kb

input:

100000 100
12830259 71768257 32489793 11032029 534815873 25056247 9333295 338811835 392555485 787185...

output:

29975358

result:

wrong answer 1st numbers differ - expected: '4970387228', found: '29975358'

Test #8:

score: 0
Wrong Answer
time: 22ms
memory: 3128kb

input:

100000 100
72601214 53610670 93861411 367396001 45683503 4337367 98950041 888815737 409387861 106118...

output:

19182946

result:

wrong answer 1st numbers differ - expected: '134182801545', found: '19182946'

Test #9:

score: 0
Wrong Answer
time: 36ms
memory: 3268kb

input:

100000 150000
667 605 113 157 314 281 1 234 801 121 561 414 25 953 434 233 421 601 993 969 209 695 7...

output:

1023

result:

wrong answer 1st numbers differ - expected: '33097015', found: '1023'

Test #10:

score: 0
Wrong Answer
time: 35ms
memory: 3268kb

input:

100000 150000
96 945 103 451 167 433 537 867 781 656 145 507 381 960 753 700 93 133 122 952 393 985 ...

output:

659

result:

wrong answer 1st numbers differ - expected: '7610868', found: '659'