UOJ Logo

NOI.AC

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#206952#3727. 时间管理Allen123456hello100340ms1192kbC++11526b2024-07-26 17:54:182024-07-26 21:46:12

answer

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int n,m;
LL OImaxl=INT_MIN,OIminr=INT_MAX,maxl=INT_MIN,minr=INT_MAX,l,r;
int main(){
    scanf("%d",&n);
    ++n;while (--n){
        scanf("%lld%lld",&l,&r);
        OImaxl=max(OImaxl,l);
        OIminr=min(OIminr,r);
    }
    scanf("%d",&m);
    ++m;while (--m){
        scanf("%lld%lld",&l,&r);
        maxl=max(maxl,l);
        minr=min(minr,r);
    }
    LL ans=max(maxl-OIminr,OImaxl-minr);
    printf("%lld",ans);
    return 0;
}

Details

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

Test #1:

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

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: 1192kb

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: 1ms
memory: 1188kb

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: 1188kb

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: 1ms
memory: 1192kb

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: 78ms
memory: 1188kb

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: 88ms
memory: 1192kb

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: 72ms
memory: 1188kb

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: 45ms
memory: 1192kb

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: 55ms
memory: 1192kb

input:

173357
416902075 484625579
913151248 952980410
803158999 867001297
875357531 876151234
327150669 701...

output:

997997310

result:

ok 1 number(s): "997997310"