UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#185678#3327. I want K-th!chendongyu100165ms2004kbC++286b2023-09-30 10:01:562023-09-30 12:05:13

answer

#include<bits/stdc++.h>
using namespace std;
long long n,k;
long long a[100500];
int main()
{
	scanf("%lld %lld",&n,&k);
	for(int i=1;i<=n;i++)
		scanf("%lld",a+i);
	sort(a+1,a+n+1);
	int j=1;
	for(;j<=k;j++)
		if(j>1&&a[j]==a[j-1])
			k++;
	cout<<a[j-1];
	return 0;
}

详细

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

Test #1:

score: 5
Accepted
time: 0ms
memory: 1256kb

input:

5000 1339
0 0 0 0 0 79460216 490148469 173637275 607130580 3240339 325158561 176577246 6513425 80190...

output:

77849078

result:

ok single line: '77849078'

Test #2:

score: 5
Accepted
time: 0ms
memory: 1260kb

input:

5000 2120
0 0 0 0 0 207855804 80831702 558516672 86116900 153748025 627223938 292226539 213414719 59...

output:

157640053

result:

ok single line: '157640053'

Test #3:

score: 5
Accepted
time: 1ms
memory: 1260kb

input:

5000 1124
0 0 0 0 0 661671703 10414092 573122634 211128290 389008620 20475885 214753143 348350946 16...

output:

60736585

result:

ok single line: '60736585'

Test #4:

score: 5
Accepted
time: 1ms
memory: 1256kb

input:

5000 605
0 0 0 0 0 551563749 121004932 307527424 198594782 130316250 59136350 225237144 547788056 23...

output:

27057012

result:

ok single line: '27057012'

Test #5:

score: 5
Accepted
time: 1ms
memory: 1256kb

input:

5000 2353
0 0 0 0 0 775478144 940918761 90340800 650344809 179864622 57216272 223183053 437720427 51...

output:

183681421

result:

ok single line: '183681421'

Test #6:

score: 5
Accepted
time: 1ms
memory: 1256kb

input:

5000 583
0 0 0 0 0 114445464 218765316 325939062 278464368 403242378 112418306 152349984 222166854 4...

output:

26835784

result:

ok single line: '26835784'

Test #7:

score: 5
Accepted
time: 0ms
memory: 1260kb

input:

5000 309
0 0 0 0 0 32045909 159342930 686070900 728852656 293586480 253801371 319225130 430025880 59...

output:

12358500

result:

ok single line: '12358500'

Test #8:

score: 5
Accepted
time: 0ms
memory: 1260kb

input:

5000 2196
0 0 0 0 0 224559381 709422415 368215158 470479100 119774820 362853801 26085849 482863240 4...

output:

160870320

result:

ok single line: '160870320'

Test #9:

score: 5
Accepted
time: 0ms
memory: 1256kb

input:

5000 1041
0 0 0 0 0 566572336 126265216 159979925 462078396 102069955 135286365 296585417 251749085 ...

output:

57935328

result:

ok single line: '57935328'

Test #10:

score: 5
Accepted
time: 1ms
memory: 1256kb

input:

5000 785
0 0 0 0 0 350508036 181988424 67039578 431740890 258700962 370301162 576818928 259865952 69...

output:

40483962

result:

ok single line: '40483962'

Test #11:

score: 5
Accepted
time: 15ms
memory: 1992kb

input:

100000 30776
0 0 0 0 0 135737406 920086770 36036148 207097968 970350383 510549820 593947393 20967060...

output:

96998544

result:

ok single line: '96998544'

Test #12:

score: 5
Accepted
time: 9ms
memory: 2000kb

input:

100000 32549
0 0 0 0 0 181697445 561610 123039930 29990207 66260893 25051215 371461752 193570344 408...

output:

104843660

result:

ok single line: '104843660'

Test #13:

score: 5
Accepted
time: 14ms
memory: 2000kb

input:

100000 31281
0 0 0 0 0 544286602 686766184 337714503 358602748 461381646 762584504 143218989 9334464...

output:

98953344

result:

ok single line: '98953344'

Test #14:

score: 5
Accepted
time: 18ms
memory: 2004kb

input:

100000 28822
0 0 0 0 0 358693064 9039744 15749888 23177756 88728984 129706824 264058560 740195688 97...

output:

88528770

result:

ok single line: '88528770'

Test #15:

score: 5
Accepted
time: 18ms
memory: 1988kb

input:

100000 22522
0 0 0 0 0 498852500 67302704 92869368 388522152 208249704 459486720 4602851 562027202 1...

output:

63823812

result:

ok single line: '63823812'

Test #16:

score: 5
Accepted
time: 18ms
memory: 1988kb

input:

100000 43979
0 0 0 0 0 149261128 651845070 121919328 159544539 463621890 625757412 169576184 4302147...

output:

164693110

result:

ok single line: '164693110'

Test #17:

score: 5
Accepted
time: 14ms
memory: 1988kb

input:

100000 41266
0 0 0 0 0 224181810 426722595 400149638 50525112 676927560 458919084 688384348 13849584...

output:

147544782

result:

ok single line: '147544782'

Test #18:

score: 5
Accepted
time: 18ms
memory: 2004kb

input:

100000 47459
0 0 0 0 0 349978161 165040935 112156800 637839020 306015047 3528060 60766230 115467132 ...

output:

186044843

result:

ok single line: '186044843'

Test #19:

score: 5
Accepted
time: 18ms
memory: 1988kb

input:

100000 41537
0 0 0 0 0 315285840 107083525 330996750 172552875 81359208 826709156 602810251 41102270...

output:

151370286

result:

ok single line: '151370286'

Test #20:

score: 5
Accepted
time: 18ms
memory: 2004kb

input:

100000 10647
0 0 0 0 0 697225144 685366248 321664162 121782150 286249256 127628934 405212320 1395604...

output:

23669942

result:

ok single line: '23669942'