ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#206970 | #3727. 时间管理 | wyz_ | 100 | 251ms | 1256kb | C++11 | 446b | 2024-07-26 18:13:43 | 2024-07-26 21:46:40 |
answer
#include<bits/stdc++.h>
using namespace std;
int n,m,al,ar = INT_MAX, bl,br = INT_MAX;
int main(){
ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
cin >> n;
for(int i = 1; i <= n; i++){
int l,r;
cin >> l >> r;
al = max(al,l);
ar = min(ar,r);
}
cin >> m;
for(int i = 1; i <= m; i++){
int l,r;
cin >> l >> r;
bl = max(bl,l);
br = min(br,r);
}
cout << max({al-br,bl-ar,0});
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1256kb
input:
109 206677059 376432734 133116858 529029801 633338966 705754959 418160930 740104881 78559518 9323680...
output:
933116406
result:
ok 1 number(s): "933116406"
Test #2:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
125 854780588 965911719 117577397 449854780 160899010 732101553 566911800 964003638 231815015 518085...
output:
928076689
result:
ok 1 number(s): "928076689"
Test #3:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
1963 940674622 980687868 989399036 998085326 808244592 903940386 759749112 900007445 646324771 77365...
output:
979189067
result:
ok 1 number(s): "979189067"
Test #4:
score: 10
Accepted
time: 0ms
memory: 1256kb
input:
1592 430702262 671522123 83650876 124506997 185588580 619190060 743564779 763138077 108207270 340995...
output:
953968585
result:
ok 1 number(s): "953968585"
Test #5:
score: 10
Accepted
time: 0ms
memory: 1252kb
input:
1743 550819545 917273302 18914772 498690033 880115396 982843377 910812836 963909479 919727551 944846...
output:
963262150
result:
ok 1 number(s): "963262150"
Test #6:
score: 10
Accepted
time: 58ms
memory: 1256kb
input:
173355 988072888 996318215 845485646 907745073 285817937 945308738 999869573 999936831 414164584 912...
output:
999871809
result:
ok 1 number(s): "999871809"
Test #7:
score: 10
Accepted
time: 56ms
memory: 1256kb
input:
186228 960755359 966756311 909077524 968761343 380461384 568056273 743779004 796247577 616108713 990...
output:
996414995
result:
ok 1 number(s): "996414995"
Test #8:
score: 10
Accepted
time: 45ms
memory: 1256kb
input:
106458 596618319 822463884 407086313 683341872 153369993 508909328 764942766 873034940 738165372 891...
output:
998706843
result:
ok 1 number(s): "998706843"
Test #9:
score: 10
Accepted
time: 43ms
memory: 1256kb
input:
156387 737422159 768831872 419237515 985144593 862952879 961848079 158339192 160312227 586588965 951...
output:
996457327
result:
ok 1 number(s): "996457327"
Test #10:
score: 10
Accepted
time: 49ms
memory: 1256kb
input:
173357 416902075 484625579 913151248 952980410 803158999 867001297 875357531 876151234 327150669 701...
output:
997997310
result:
ok 1 number(s): "997997310"