QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#439639#8711. TilesA_zjzj26 175ms48084kbC++174.5kb2024-06-12 15:18:212024-06-12 15:18:21

Judging History

你现在查看的是最新测评结果

  • [2024-06-12 15:18:21]
  • 评测
  • 测评结果:26
  • 用时:175ms
  • 内存:48084kb
  • [2024-06-12 15:18:21]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include"debug.h"
#else
#define debug(...) void()
#endif
#define all(x) (x).begin(),(x).end()
template<class T>
auto ary(T *a,int l,int r){
	return vector<T>{a+l,a+1+r};
}
using ll=long long;
using ull=unsigned ll;
const int N=2e5+10,M=N*2;
int n;
struct node{
	int x,y;
}a[N];
ll cross(node a,node b){
	return 1ll*a.x*b.y-1ll*a.y*b.x;
}
vector<int>nx,ny;
using vec=array<int,4>;
#ifdef DEBUG
ostream& operator << (ostream &out,vec a){
	out<<'[';
	for(auto x:a)out<<x<<',';
	return out<<']';
}
#endif
namespace SGT1{
	const vec I={0,1,2,3};
	vec operator + (const vec &a,const vec &b){
		static vec c;
		for(int i=0;i<4;i++)c[i]=a[i]+b[i];
		return c;
	}
	vec merge(const vec &a,const vec &b){
		static vec c;
		for(int i=0;i<4;i++)c[i]=b[a[i]];
		return c;
	}
	vec Merge(const vec &a,const vec &b){
		static vec c;
		c.fill(0);
		for(int i=0;i<4;i++)c[b[i]]+=a[i];
		return c;
	}
	vec t[M<<2],laz[M<<2];
	void pushup(int rt){
		t[rt]=t[rt<<1]+t[rt<<1|1];
	}
	void pushlaz(int rt,vec x){
		t[rt]=Merge(t[rt],x);
		laz[rt]=merge(laz[rt],x);
	}
	void pushdown(int rt){
		if(laz[rt]!=I){
			pushlaz(rt<<1,laz[rt]);
			pushlaz(rt<<1|1,laz[rt]);
			laz[rt]=I;
		}
	}
	void build(int l=0,int r=ny.size()-2,int rt=1){
		laz[rt]=I;
		if(l==r)return t[rt][0]=ny[l+1]-ny[l],void();
		int mid=(l+r)>>1;
		build(l,mid,rt<<1);
		build(mid+1,r,rt<<1|1);
		pushup(rt);
	}
	void update(int L,int R,vec x,int l=0,int r=ny.size()-2,int rt=1){
		// if(rt==1)debug("update",L,R,x);
		if(L<=l&&r<=R)return pushlaz(rt,x);
		int mid=(l+r)>>1;
		pushdown(rt);
		if(L<=mid)update(L,R,x,l,mid,rt<<1);
		if(mid<R)update(L,R,x,mid+1,r,rt<<1|1);
		pushup(rt);
	}
	vec query(int L=0,int R=ny.size()-2,int l=0,int r=ny.size()-2,int rt=1){
		if(L<=l&&r<=R)return t[rt];
		int mid=(l+r)>>1;
		pushdown(rt);
		if(R<=mid)return query(L,R,l,mid,rt<<1);
		if(mid<L)return query(L,R,mid+1,r,rt<<1|1);
		return query(L,R,l,mid,rt<<1)+query(L,R,mid+1,r,rt<<1|1);
	}
}
namespace SGT2{
	struct node{
		int st,ed,cnt;
		bool f,g;
	};
	node operator + (const node &a,const node &b){
		if(a.st==-1)return b;
		if(b.st==-1)return a;
		if(a.cnt%2==0)return {a.st,b.ed,a.cnt+b.cnt,a.f&&b.f,a.g&&b.g&&(b.st-a.ed)%2==0};
		else return {a.st,b.ed,a.cnt+b.cnt,a.f&&b.g&&(b.st-a.ed)%2==0,a.g&&b.f};
	}
	node t[M<<2];
	void pushup(int rt){
		t[rt]=t[rt<<1]+t[rt<<1|1];
	}
	void build(int l=0,int r=ny.size()-1,int rt=1){
		t[rt]={-1,-1,0,0,0};
		if(l==r)return;
		int mid=(l+r)>>1;
		build(l,mid,rt<<1);
		build(mid+1,r,rt<<1|1);
	}
	void update(int x,int l=0,int r=ny.size()-1,int rt=1){
		// if(rt==1)debug("update",x);
		if(l==r){
			if(t[rt].st==-1)t[rt]={ny[l],ny[l],1,1,1};
			else t[rt]={-1,-1,0,0,0};
			return;
		}
		int mid=(l+r)>>1;
		if(x<=mid)update(x,l,mid,rt<<1);
		else update(x,mid+1,r,rt<<1|1);
		pushup(rt);
	}
	bool query(){
		return t[1].f;
	}
}
vector<pair<int,int>>o1[M],o2[M];
int main(){
	scanf("%d%*d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i].x,&a[i].y);
	}
	if([&](){
		ll s=0;
		for(int i=1;i<=n;i++){
			s+=cross(a[i],a[i%n+1]);
		}
		return s<0;
	}())reverse(a+1,a+1+n);
	for(int i=1;i<=n;i++){
		nx.push_back(a[i].x);
		ny.push_back(a[i].y);
	}
	sort(all(nx)),nx.erase(unique(all(nx)),nx.end());
	sort(all(ny)),ny.erase(unique(all(ny)),ny.end());
	for(int i=1;i<=n;i++){
		a[i].x=lower_bound(all(nx),a[i].x)-nx.begin();
		a[i].y=lower_bound(all(ny),a[i].y)-ny.begin();
	}
	for(int i=1;i<=n;i++){
		int j=i%n+1;
		if(a[i].x!=a[j].x)continue;
		if(a[i].y>a[j].y){
			o1[a[i].x].push_back({a[j].y,a[i].y});
		}else{
			o2[a[i].x].push_back({a[i].y,a[j].y});
		}
	}
	int ans=0;
	SGT1::build();
	SGT2::build();
	// debug(nx,ny);
	for(int i=0;i+1<nx.size();i++){
		if(![&](){
			for(auto [l,r]:o1[i]){
				SGT1::update(l,r-1,vec({1,1,3,3}));
				SGT2::update(l),SGT2::update(r);
				if(!SGT2::query())return 0;
			}
			for(auto [l,r]:o2[i]){
				auto res=SGT1::query(l,r-1);
				if(res[2]||res[3])return 0;
				SGT1::update(l,r-1,vec({0,0,2,2}));
				SGT2::update(l),SGT2::update(r);
				if(!SGT2::query())return 0;
			}
			int d=nx[i+1]-nx[i];
			static vec t={0,3,2,1};
			if(d%2==0)SGT1::update(0,ny.size()-2,t);
			auto res=SGT1::query();
			// debug(i,res);
			if(!res[2]&&!res[3])ans=nx[i+1]-1;
			SGT1::update(0,ny.size()-2,t);
			res=SGT1::query();
			// debug(i,res);
			if(!res[2]&&!res[3])ans=nx[i+1];
			return 1;
		}())break;
	}
	cout<<ans<<endl;
	return 0;
}
#ifdef DEBUG
#include"debug.hpp"
#endif

详细

Subtask #1:

score: 4
Accepted

Test #1:

score: 4
Accepted
time: 0ms
memory: 28824kb

input:

4 3
0 0
0 3
3 3
3 0

output:

0

result:

ok single line: '0'

Test #2:

score: 0
Accepted
time: 3ms
memory: 28760kb

input:

4 999999999
999999999 0
999999999 1000000000
0 1000000000
0 0

output:

999999998

result:

ok single line: '999999998'

Test #3:

score: 0
Accepted
time: 0ms
memory: 28904kb

input:

4 875
875 0
0 0
0 284
875 284

output:

874

result:

ok single line: '874'

Test #4:

score: 0
Accepted
time: 3ms
memory: 29148kb

input:

4 317
317 0
317 920
0 920
0 0

output:

316

result:

ok single line: '316'

Test #5:

score: 0
Accepted
time: 0ms
memory: 27576kb

input:

4 912
912 814
912 0
0 0
0 814

output:

912

result:

ok single line: '912'

Test #6:

score: 0
Accepted
time: 0ms
memory: 27432kb

input:

4 2
0 0
0 1
2 1
2 0

output:

0

result:

ok single line: '0'

Test #7:

score: 0
Accepted
time: 3ms
memory: 30448kb

input:

4 1
0 0
0 1
1 1
1 0

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 30636kb

input:

4 412
412 998
0 998
0 17
412 17

output:

0

result:

ok single line: '0'

Test #9:

score: 0
Accepted
time: 0ms
memory: 28696kb

input:

4 87523458
87523458 42385699
0 42385699
0 23498231
87523458 23498231

output:

87523458

result:

ok single line: '87523458'

Test #10:

score: 0
Accepted
time: 0ms
memory: 29172kb

input:

4 1
0 0
0 1000000000
1 1000000000
1 0

output:

0

result:

ok single line: '0'

Test #11:

score: 0
Accepted
time: 0ms
memory: 30536kb

input:

4 1000000000
1000000000 0
1000000000 1000000000
0 1000000000
0 0

output:

1000000000

result:

ok single line: '1000000000'

Subtask #2:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Test #12:

score: 9
Accepted
time: 3ms
memory: 30660kb

input:

5 29034873
29034873 13721
0 13721
0 99198237
29034870 99198237
29034873 99198237

output:

29034872

result:

ok single line: '29034872'

Test #13:

score: 0
Accepted
time: 3ms
memory: 30052kb

input:

6 999999993
2934870 21349
2934870 3423847
0 3423847
0 91827393
999999993 91827393
999999993 21349

output:

999999992

result:

ok single line: '999999992'

Test #14:

score: 0
Accepted
time: 0ms
memory: 29220kb

input:

6 401
153 409
153 751
0 751
0 909
401 909
401 409

output:

152

result:

ok single line: '152'

Test #15:

score: 0
Accepted
time: 0ms
memory: 29928kb

input:

5 726
0 286
0 315
726 315
726 122
0 122

output:

0

result:

ok single line: '0'

Test #16:

score: 0
Accepted
time: 3ms
memory: 30136kb

input:

6 999
616 129
616 311
0 311
0 529
999 529
999 129

output:

998

result:

ok single line: '998'

Test #17:

score: 0
Accepted
time: 3ms
memory: 29948kb

input:

6 3
0 0
0 4
3 4
3 2
2 2
2 0

output:

2

result:

ok single line: '2'

Test #18:

score: 0
Accepted
time: 0ms
memory: 27740kb

input:

6 3
0 0
0 2
1 2
1 3
3 3
3 0

output:

0

result:

ok single line: '0'

Test #19:

score: 0
Accepted
time: 0ms
memory: 30252kb

input:

6 717
204 1000
0 1000
0 306
548 306
717 306
717 1000

output:

716

result:

ok single line: '716'

Test #20:

score: 0
Accepted
time: 0ms
memory: 27504kb

input:

6 804
785 17
785 665
0 665
0 969
804 969
804 17

output:

784

result:

ok single line: '784'

Test #21:

score: 0
Accepted
time: 0ms
memory: 30568kb

input:

6 973
973 772
973 122
42 122
42 6
0 6
0 772

output:

972

result:

ok single line: '972'

Test #22:

score: 0
Accepted
time: 3ms
memory: 29236kb

input:

6 615
492 993
492 748
615 748
615 311
0 311
0 993

output:

492

result:

ok single line: '492'

Test #23:

score: 0
Accepted
time: 0ms
memory: 29036kb

input:

6 999
999 424
999 302
83 302
83 70
0 70
0 424

output:

82

result:

ok single line: '82'

Test #24:

score: 0
Accepted
time: 0ms
memory: 30132kb

input:

6 884
884 622
884 317
228 317
228 96
0 96
0 622

output:

228

result:

ok single line: '228'

Test #25:

score: 0
Accepted
time: 0ms
memory: 29196kb

input:

6 6
0 6
3 6
3 4
6 4
6 0
0 0

output:

2

result:

ok single line: '2'

Test #26:

score: 0
Accepted
time: 0ms
memory: 27508kb

input:

6 6
0 4
5 4
5 2
6 2
6 0
0 0

output:

4

result:

ok single line: '4'

Test #27:

score: 0
Accepted
time: 0ms
memory: 29184kb

input:

6 6
0 6
2 6
2 4
6 4
6 0
0 0

output:

6

result:

ok single line: '6'

Test #28:

score: 0
Accepted
time: 3ms
memory: 30104kb

input:

6 6
0 6
1 6
1 4
6 4
6 0
0 0

output:

0

result:

ok single line: '0'

Test #29:

score: 0
Accepted
time: 3ms
memory: 30400kb

input:

6 802
0 60
802 60
802 604
288 604
288 271
0 271

output:

0

result:

ok single line: '0'

Test #30:

score: 0
Accepted
time: 3ms
memory: 29204kb

input:

5 318
0 782
318 782
318 256
318 148
0 148

output:

318

result:

ok single line: '318'

Test #31:

score: -9
Wrong Answer
time: 3ms
memory: 27524kb

input:

6 994
994 511
994 76
0 76
0 135
0 782
994 782

output:

0

result:

wrong answer 1st lines differ - expected: '994', found: '0'

Subtask #3:

score: 0
Wrong Answer

Test #32:

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

input:

1551 1000
0 988
2 988
3 988
6 988
6 985
6 982
6 981
6 979
6 978
6 977
6 976
6 975
6 974
6 972
6 970
6 969
6 968
6 966
6 965
6 964
7 964
8 964
8 963
8 961
8 960
10 960
11 960
13 960
16 960
16 959
16 958
16 957
16 954
16 953
16 951
16 950
17 950
18 950
18 948
18 946
18 945
18 944
18 942
18 941
18 939
...

output:

6

result:

wrong answer 1st lines differ - expected: '164', found: '6'

Subtask #4:

score: 0
Wrong Answer

Test #45:

score: 19
Accepted
time: 3ms
memory: 27704kb

input:

14 6
0 1
0 3
2 3
2 4
0 4
0 6
3 6
3 7
4 7
6 7
6 5
3 5
3 2
3 1

output:

2

result:

ok single line: '2'

Test #46:

score: -19
Wrong Answer
time: 0ms
memory: 29240kb

input:

18 9
0 2
2 2
2 1
4 1
4 0
9 0
9 2
4 2
4 4
7 4
7 3
9 3
9 6
4 6
4 5
2 5
2 4
0 4

output:

2

result:

wrong answer 1st lines differ - expected: '6', found: '2'

Subtask #5:

score: 22
Accepted

Test #89:

score: 22
Accepted
time: 41ms
memory: 33504kb

input:

199996 198506138
31225688 248200160
31225688 248291950
28995282 248291950
28995282 248200160
26764876 248200160
26764876 248291950
24534470 248291950
24534470 248200160
22304064 248200160
22304064 248291950
20073658 248291950
20073658 248200160
17843252 248200160
17843252 248291950
15612846 24829195...

output:

0

result:

ok single line: '0'

Test #90:

score: 0
Accepted
time: 45ms
memory: 31088kb

input:

199996 740789144
48843244 341844840
48843244 342042210
40702704 342042210
40702704 341844840
32562164 341844840
32562164 342042210
24421624 342042210
24421624 341844840
16281084 341844840
16281084 342042210
8140544 342042210
8140544 341450100
16281084 341450100
16281084 341647470
24421624 341647470
...

output:

0

result:

ok single line: '0'

Test #91:

score: 0
Accepted
time: 77ms
memory: 33432kb

input:

199996 198506138
31225684 248200166
31225684 248291956
28995278 248291956
28995278 248200166
26764872 248200166
26764872 248291956
24534466 248291956
24534466 248200166
22304060 248200166
22304060 248291956
20073654 248291956
20073654 248200166
17843248 248200166
17843248 248291956
15612842 24829195...

output:

198506134

result:

ok single line: '198506134'

Test #92:

score: 0
Accepted
time: 78ms
memory: 33512kb

input:

199996 740789144
48843240 341844840
48843240 342042210
40702700 342042210
40702700 341844840
32562160 341844840
32562160 342042210
24421620 342042210
24421620 341844840
16281080 341844840
16281080 342042210
8140540 342042210
8140540 341450100
16281080 341450100
16281080 341647470
24421620 341647470
...

output:

740789140

result:

ok single line: '740789140'

Test #93:

score: 0
Accepted
time: 93ms
memory: 47884kb

input:

199999 1000000000
1000000000 0
999999222 0
999999222 136
999984018 136
999984018 228
999973482 228
999973482 292
999971160 292
999971160 396
999964886 396
999964886 588
999959042 588
999959042 680
999955190 680
999955190 732
999927188 732
999927188 748
999913912 748
999913912 796
999912122 796
99991...

output:

13366

result:

ok single line: '13366'

Test #94:

score: 0
Accepted
time: 116ms
memory: 47852kb

input:

200000 1000000000
684694139 795608956
684694139 795624096
684697059 795624096
684697059 795626100
684706431 795626100
684706431 795627636
684723897 795627636
684723897 795629488
684739661 795629488
684739661 795629884
684747463 795629884
684747463 795637960
684749717 795637960
684749717 795650464
68...

output:

33676

result:

ok single line: '33676'

Test #95:

score: 0
Accepted
time: 75ms
memory: 47880kb

input:

200000 1000000000
46181104 58318020
46181104 58296528
46177454 58296528
46177454 58295540
46175192 58295540
46175192 58283280
46160546 58283280
46160546 58257456
46152376 58257456
46152376 58240260
46149232 58240260
46149232 58234984
46135618 58234984
46135618 58228216
46117434 58228216
46117434 582...

output:

257649284

result:

ok single line: '257649284'

Test #96:

score: 0
Accepted
time: 55ms
memory: 33588kb

input:

199996 554773273
457247489 96654740
457247489 98035522
457386217 98035522
457386217 99416304
457247489 99416304
457247489 100797086
457386217 100797086
457386217 102177868
457247489 102177868
457247489 103558650
457386217 103558650
457386217 104939432
457247489 104939432
457247489 106320214
45738621...

output:

392045328

result:

ok single line: '392045328'

Test #97:

score: 0
Accepted
time: 145ms
memory: 44248kb

input:

200000 229224511
46953728 111136872
46953728 201498610
46956022 201498610
46956022 37625500
46956912 37625500
46956912 469175628
46963572 469175628
46963572 66952164
46970390 66952164
46970390 421248598
46973034 421248598
46973034 128514806
46975726 128514806
46975726 464889238
46984802 464889238
46...

output:

135429144

result:

ok single line: '135429144'

Test #98:

score: 0
Accepted
time: 79ms
memory: 31564kb

input:

199996 964660429
619288176 312580210
607378788 312580210
607378788 312479280
595469400 312479280
595469400 312580210
583560012 312580210
583560012 312479280
571650624 312479280
571650624 312580210
559741236 312580210
559741236 312479280
547831848 312479280
547831848 312580210
535922460 312580210
535...

output:

690744504

result:

ok single line: '690744504'

Test #99:

score: 0
Accepted
time: 157ms
memory: 39740kb

input:

199996 414489878
19146915 609931048
19146915 609920864
92049178 609920864
92049178 609893324
12305150 609893324
12305150 609893054
153291573 609893054
153291573 609838290
135815842 609838290
135815842 609833352
180535220 609833352
180535220 609831380
178284247 609831380
178284247 609825486
181261700...

output:

2958

result:

ok single line: '2958'

Test #100:

score: 0
Accepted
time: 82ms
memory: 33600kb

input:

199991 771677560
306811560 386813532
306811560 386591608
316108880 386591608
316108880 386813532
325406200 386813532
325406200 386591608
334703520 386591608
334703520 386813532
344000840 386813532
344000840 386591608
353298160 386591608
353298160 386813532
362595480 386813532
362595480 386591608
371...

output:

18196938

result:

ok single line: '18196938'

Test #101:

score: 0
Accepted
time: 58ms
memory: 31624kb

input:

199991 746609608
578832168 160701904
570443296 160701904
570443296 160814126
562054424 160814126
562054424 160701904
553665552 160701904
553665552 160814126
545276680 160814126
545276680 160701904
536887808 160701904
536887808 160814126
528498936 160814126
528498936 160701904
520110064 160701904
520...

output:

77051858

result:

ok single line: '77051858'

Test #102:

score: 0
Accepted
time: 57ms
memory: 33408kb

input:

199991 889783910
565274484 7862400
565274484 7864920
554806438 7864920
554806438 7862400
544338392 7862400
544338392 7864920
533870346 7864920
533870346 7862400
523402300 7862400
523402300 7864920
512934254 7864920
512934254 7862400
502466208 7862400
502466208 7864920
491998162 7864920
491998162 786...

output:

227424044

result:

ok single line: '227424044'

Test #103:

score: 0
Accepted
time: 80ms
memory: 33612kb

input:

199991 518096946
384206724 418327442
378385410 418327442
378385410 418122480
372564096 418122480
372564096 418327442
366742782 418327442
366742782 418122480
360921468 418122480
360921468 418327442
355100154 418327442
355100154 418122480
349278840 418122480
349278840 418327442
343457526 418327442
343...

output:

518096946

result:

ok single line: '518096946'

Test #104:

score: 0
Accepted
time: 92ms
memory: 48008kb

input:

200000 1000000000
0 0
2 0
2 4902
999900202 4902
999900202 4904
99800 4904
99800 12184
999900204 12184
999900204 12186
99798 12186
99798 31754
999900206 31754
999900206 31756
99796 31756
99796 45504
999900208 45504
999900208 45506
99794 45506
99794 57408
999900210 57408
999900210 57410
99792 57410
99...

output:

999968188

result:

ok single line: '999968188'

Test #105:

score: 0
Accepted
time: 91ms
memory: 48064kb

input:

200000 1000000000
0 0
2 0
2 12518
999900202 12518
999900202 12520
99800 12520
99800 22674
999900204 22674
999900204 22676
99798 22676
99798 23532
999900206 23532
999900206 23534
99796 23534
99796 40620
999900208 40620
999900208 40622
99794 40622
99794 52164
999900210 52164
999900210 52166
99792 5216...

output:

999976726

result:

ok single line: '999976726'

Test #106:

score: 0
Accepted
time: 99ms
memory: 48008kb

input:

200000 1000000000
0 0
2 0
2 18824
999900202 18824
999900202 18826
99800 18826
99800 36562
999900204 36562
999900204 36564
99798 36564
99798 43738
999900206 43738
999900206 43740
99796 43740
99796 59422
999900208 59422
999900208 59424
99794 59424
99794 68608
999900210 68608
999900210 68610
99792 6861...

output:

999962988

result:

ok single line: '999962988'

Test #107:

score: 0
Accepted
time: 164ms
memory: 47900kb

input:

199998 999999999
999999999 0
29093 0
29093 2
28146 2
28146 4
83545 4
83545 6
20314 6
20314 8
67113 8
67113 10
70882 10
70882 12
58521 12
58521 14
17698 14
17698 16
87723 16
87723 18
18644 18
18644 20
97595 20
97595 22
14584 22
14584 24
19921 24
19921 26
614 26
614 28
70507 28
70507 30
87100 30
87100...

output:

0

result:

ok single line: '0'

Test #108:

score: 0
Accepted
time: 90ms
memory: 47904kb

input:

199998 999999999
999999999 0
99997 0
99997 2
99996 2
99996 4
99995 4
99995 6
99994 6
99994 8
99993 8
99993 10
99992 10
99992 12
99991 12
99991 14
99990 14
99990 16
99989 16
99989 18
99988 18
99988 20
99987 20
99987 22
99986 22
99986 24
99985 24
99985 26
99984 26
99984 28
99983 28
99983 30
99982 30
9...

output:

0

result:

ok single line: '0'

Test #109:

score: 0
Accepted
time: 124ms
memory: 47932kb

input:

199998 999999999
999999999 1000000000
99997 1000000000
99997 999999998
99996 999999998
99996 999999996
99995 999999996
99995 999999994
99994 999999994
99994 999999992
99993 999999992
99993 999999990
99992 999999990
99992 999999988
99991 999999988
99991 999999986
99990 999999986
99990 999999984
99989...

output:

0

result:

ok single line: '0'

Test #110:

score: 0
Accepted
time: 46ms
memory: 31556kb

input:

199996 810973206
62257758 269561376
62054964 269561376
62054964 266352312
62257758 266352312
62257758 263143248
62054964 263143248
62054964 259934184
62257758 259934184
62257758 256725120
62054964 256725120
62054964 253516056
62257758 253516056
62257758 250306992
62054964 250306992
62054964 24709792...

output:

810973206

result:

ok single line: '810973206'

Test #111:

score: 0
Accepted
time: 79ms
memory: 31432kb

input:

199996 205981244
185151680 48293064
185151680 48464316
187466076 48464316
187466076 48293064
189780472 48293064
189780472 48464316
192094868 48464316
192094868 48293064
194409264 48293064
194409264 48464316
196723660 48464316
196723660 48293064
199038056 48293064
199038056 48464316
201352452 4846431...

output:

205981244

result:

ok single line: '205981244'

Test #112:

score: 0
Accepted
time: 52ms
memory: 33528kb

input:

200000 867239146
70480800 899350
70480800 1798700
70263936 1798700
70263936 2698050
70480800 2698050
70480800 3597400
70263936 3597400
70263936 4496750
70480800 4496750
70480800 5396100
70263936 5396100
70263936 6295450
70480800 6295450
70480800 7194800
70263936 7194800
70263936 8094150
70480800 809...

output:

867239136

result:

ok single line: '867239136'

Test #113:

score: 0
Accepted
time: 80ms
memory: 33508kb

input:

200000 721800034
630537952 318200352
630537952 318405378
622241400 318405378
622241400 318200352
613944848 318200352
613944848 318405378
605648296 318405378
605648296 318200352
597351744 318200352
597351744 318405378
589055192 318405378
589055192 318200352
580758640 318200352
580758640 318405378
572...

output:

721800026

result:

ok single line: '721800026'

Test #114:

score: 0
Accepted
time: 175ms
memory: 39796kb

input:

200000 1000000000
688828389 692289462
980164574 692289462
980164574 692292452
754623979 692292452
754623979 692324788
778323410 692324788
778323410 692332592
565018780 692332592
565018780 692364084
911143534 692364084
911143534 692390176
508865707 692390176
508865707 692401256
715710694 692401256
71...

output:

1000000000

result:

ok single line: '1000000000'

Test #115:

score: 0
Accepted
time: 3ms
memory: 30316kb

input:

20 912873454
0 92837490
0 9812736
5438570 9812736
5438570 439474
0 439474
0 9092
912873454 9092
912873454 439474
81236182 439474
81236182 9812736
912873454 9812736
912873454 92837490
81236182 92837490
81236182 365827590
912873454 365827590
912873454 889347298
0 889347298
0 365827590
5438570 36582759...

output:

912873454

result:

ok single line: '912873454'

Test #116:

score: 0
Accepted
time: 0ms
memory: 30376kb

input:

8 962374453
962374453 91232
2837461 91232
2837461 49328474
0 49328474
0 837432648
793264844 837432648
793264844 49328474
962374453 49328474

output:

962374453

result:

ok single line: '962374453'

Test #117:

score: 0
Accepted
time: 110ms
memory: 39856kb

input:

199992 49999
40580 81160
40579 81160
40579 81158
40578 81158
40578 81156
40577 81156
40577 81154
40576 81154
40576 81152
40575 81152
40575 81150
40574 81150
40574 81148
40573 81148
40573 81146
40572 81146
40572 81144
40571 81144
40571 81142
40570 81142
40570 81140
40569 81140
40569 81138
40568 81138...

output:

49999

result:

ok single line: '49999'

Subtask #6:

score: 0
Wrong Answer

Test #118:

score: 25
Accepted
time: 50ms
memory: 48084kb

input:

200000 1000000000
1000000000 0
999990876 0
999990876 38
999972524 38
999972524 1510
999969180 1510
999969180 3734
999964780 3734
999964780 4138
999960464 4138
999960464 11052
999953728 11052
999953728 24478
999914972 24478
999914972 25892
999909864 25892
999909864 28102
999902920 28102
999902920 301...

output:

40502

result:

ok single line: '40502'

Test #119:

score: 0
Accepted
time: 103ms
memory: 41928kb

input:

200000 778696306
22822858 87970191
330038016 87970191
330038016 87957657
259262362 87957657
259262362 87923225
316313936 87923225
316313936 87896643
155653960 87896643
155653960 87890367
184851800 87890367
184851800 87877609
93595576 87877609
93595576 87838069
384366344 87838069
384366344 87822439
3...

output:

298364980

result:

ok single line: '298364980'

Test #120:

score: -25
Wrong Answer
time: 77ms
memory: 44288kb

input:

199996 939450484
183372590 726043385
183372590 947636904
183351398 947636904
183351398 585647776
183326398 585647776
183326398 815654133
183324414 815654133
183324414 681316487
183304068 681316487
183304068 993350372
183281288 993350372
183281288 748476649
183258832 748476649
183258832 772289334
183...

output:

35398

result:

wrong answer 1st lines differ - expected: '158652', found: '35398'

Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%