UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#200972#704. 第K小的数ChenHanzhang02ms1196kbC++288b2024-01-14 19:57:042024-01-14 19:57:06

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long l1,l2,r1,r2,k;
	cin>>l1>>l2>>r1>>r2>>k;
	if(l1>l2){
		swap(l1,l2);
		swap(r1,r2);
	}
	if(l2<=r1) cout<<l1+k-1<<endl;
	else if(r1-l1+1<k) cout<<l2+(k-(r1-l1+1))-1<<endl;
	else cout<<l1+k-1<<endl;
	return 0;
}

详细

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

Test #1:

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

input:

8886 6221 78097 91055 74492

output:

80712

result:

wrong answer 1st lines differ - expected: '44799', found: '80712'

Test #2:

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

input:

8485 4137 10391 92418 17568

output:

21704

result:

wrong answer 1st lines differ - expected: '19797', found: '21704'

Test #3:

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

input:

8971 10295 71065 64956 44009

output:

52979

result:

wrong answer 1st lines differ - expected: '31637', found: '52979'

Test #4:

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

input:

10684 8717 80822 67687 3240

output:

11956

result:

wrong answer 1st lines differ - expected: '11320', found: '11956'

Test #5:

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

input:

3958 1898 85945 51639 18644

output:

20541

result:

wrong answer 1st lines differ - expected: '12249', found: '20541'

Test #6:

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

input:

1793 1883 56708 52929 67645

output:

69437

result:

wrong answer 1st lines differ - expected: '35660', found: '69437'

Test #7:

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

input:

9170 6442 44565277 52007711 60198538

output:

60204979

result:

wrong answer 1st lines differ - expected: '30107074', found: '60204979'

Test #8:

score: 0
Wrong Answer
time: 1ms
memory: 1196kb

input:

6503 4398 42576185 41246506 39953330

output:

39957727

result:

wrong answer 1st lines differ - expected: '19982115', found: '39957727'

Test #9:

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

input:

8810 1858 83829062 7992207 44881061

output:

44882918

result:

wrong answer 1st lines differ - expected: '36899520', found: '44882918'

Test #10:

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

input:

2043 5959 76809751 61209845 80275334

output:

80277376

result:

wrong answer 1st lines differ - expected: '40141667', found: '80277376'

Test #11:

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

input:

3545 10083 89218900 13553199 23421584

output:

23425128

result:

wrong answer 1st lines differ - expected: '11717605', found: '23425128'

Test #12:

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

input:

9475 3919 29090865 62401189 66501333

output:

66505251

result:

wrong answer 1st lines differ - expected: '37423860', found: '66505251'

Test #13:

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

input:

10852 1890 62828646567693 870312128990889 105911095951062

output:

105911095952951

result:

wrong answer 1st lines differ - expected: '52955547981901', found: '105911095952951'

Test #14:

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

input:

2752 6137 841041922084030 428187075059640 226616769271876

output:

226616769274627

result:

wrong answer 1st lines differ - expected: '113308384640382', found: '226616769274627'

Test #15:

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

input:

5351 7789 956375681249281 133146269380995 871031626016150

output:

871031626021500

result:

wrong answer 1st lines differ - expected: '737885356648293', found: '871031626021500'

Test #16:

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

input:

1456 8032 419885911205932 252590350792861 422791002642414

output:

422791002643869

result:

wrong answer 1st lines differ - expected: '211395501325950', found: '422791002643869'

Test #17:

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

input:

4766 8958 955796731208347 306051927627717 1030986287617089

output:

1030986287621854

result:

wrong answer 1st lines differ - expected: '724934360003094', found: '1030986287621854'

Test #18:

score: 0
Wrong Answer
time: 1ms
memory: 1192kb

input:

4675 8280 331918804272602 558377646810381 51805988620085

output:

51805988624759

result:

wrong answer 1st lines differ - expected: '25902994316519', found: '51805988624759'

Test #19:

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

input:

8246 2444 1000000000008245 1000000000002443 1589841792991229

output:

1589841792993672

result:

wrong answer 1st lines differ - expected: '794920896500959', found: '1589841792993672'

Test #20:

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

input:

7890 10350 1000000000007889 1000000000010349 787505365966203

output:

787505365974092

result:

wrong answer 1st lines differ - expected: '393752682992221', found: '787505365974092'