QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#152715#6424. GoqzezAC ✓849ms180860kbC++144.4kb2023-08-28 18:19:272023-08-28 18:19:28

Judging History

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

  • [2023-08-28 18:19:28]
  • 评测
  • 测评结果:AC
  • 用时:849ms
  • 内存:180860kb
  • [2023-08-28 18:19:27]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<typename T>
ostream& operator << (ostream &out,const vector<T>&x){
	if(x.empty())return out<<"[]";
	out<<'['<<x[0];
	for(int len=x.size(),i=1;i<len;i++)out<<','<<x[i];
	return out<<']';
}
template<typename T>
vector<T> ary(const T *a,int l,int r){
	return vector<T>{a+l,a+1+r};
}
template<typename T>
void debug(T x){
	cerr<<x<<'\n';
}
template<typename T,typename ...S>
void debug(T x,S ...y){
	cerr<<x<<' ',debug(y...);
}
const int N=1e3+10,M=N*N,base=1e6+7,mod=1e9+7;
const int dx[4]={0,0,1,-1};
const int dy[4]={1,-1,0,0};
#define To(i,j,k) \
	for(int k=0,x,y;k<4;k++)\
		if(x=i+dx[k],y=j+dy[k],min(x,y)>=1&&max(x,y)<=n)
int T,n;
char a[N][N];
int id[N][N],ans[N][N];
int k,fa[M],siz[M],is[M];
int find(int x){
	return fa[x]==x?x:fa[x]=find(fa[x]);
}
void merge(int x,int y){
	x=find(x),y=find(y);
	if(x==y)return;
	siz[x]+=siz[y],fa[y]=x;
}
vector<int>A[M];
void add(int u,int v){
	merge(u,v);
	// debug(u,v);
	A[u].push_back(v),A[v].push_back(u);
}
int now;
void solve1(){
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(a[i][j]=='x'){
				bool flag=0;
				To(i,j,k)flag|=a[x][y]=='.';
				if(!flag){
					To(i,j,k)flag|=a[x][y]=='o'&&is[find(id[x][y])];
				}
				if(flag){
					ans[i][j]=now;
					vector<int>t;
					To(i,j,k)if(a[x][y]=='o')
						t.push_back(find(id[x][y]));
					sort(t.begin(),t.end());
					t.erase(unique(t.begin(),t.end()),t.end());
					// debug(i,j,t);
					for(int x:t)if(!is[x])ans[i][j]-=siz[x];
				}else{
					ans[i][j]=now+1;
				}
			}
		}
	}
}
const int V=M*2;
int m,dft,top,dfn[M],low[M],stk[M];
vector<int>B[V];
void adde(int u,int v){
	// debug("edge",u,v);
	B[u].push_back(v),B[v].push_back(u);
}
void tarjan(int u,int fa=0){
	dfn[u]=low[u]=++dft,stk[++top]=u;
	for(int v:A[u])if(v^fa){
		if(!dfn[v]){
			tarjan(v,u),low[u]=min(low[u],low[v]);
			if(low[v]>=dfn[u]){
				adde(++m,u);
				// debug("stk",ary(stk,1,top),v);
				do adde(stk[top],m);while(stk[top--]^v);
			}
		}else low[u]=min(low[u],dfn[v]);
	}
}
int cnt[V],tot[V],p[V];
void dfs(int u,int fa=0){
	p[u]=fa;
	for(int v:B[u])if(v^fa){
		dfs(v,u);
		tot[u]+=tot[v],cnt[u]+=cnt[v];
	}
}
void solve2(){
	m=k,dft=top=0;
	fill(dfn+1,dfn+1+k,0);
	for(int i=1;i<=k;i++)if(!dfn[i])tarjan(i);
	for(int i=1;i<=m;i++)tot[i]=i<=k;
	// debug("cnt",ary(cnt,1,m));
	for(int i=1;i<=k;i++)if(fa[i]==i)dfs(i);
	// debug("cnt",ary(cnt,1,m));
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(a[i][j]!='o')continue;
			int u=id[i][j];
			// debug(i,j,u);
			if(!is[find(u)])ans[i][j]=now-1;
			else{
				ans[i][j]=now;
				// debug("ans",i,j,ans[i][j]);
				for(int v:B[u])if(v^p[u]){
					if(!cnt[v])ans[i][j]+=tot[v];
				}
				if(cnt[find(u)]==cnt[u]){
					ans[i][j]+=tot[find(u)]-tot[u];
				}
			}
		}
	}
}
void get(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%s",a[i]+1);
	k=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if(a[i][j]=='o')id[i][j]=++k;
			else id[i][j]=0;
			ans[i][j]=0;
		}
	}
	// debug("k",k);
	iota(fa,fa+1+k,0),fill(siz+1,siz+1+k,1),fill(is+1,is+1+k,0);
	// for(int i=1;i<=k;i++)debug(i,A[i]);
	// for(int i=1;i<=n;i++)debug(ary(id[i],1,n));
	for(int i=1;i<=n;i++)for(int j=1;j<n;j++){
		if(a[i][j]=='o'&&a[i][j+1]=='o'){
			add(id[i][j],id[i][j+1]);
		}
	}
	// for(int i=1;i<=k;i++)debug(i,A[i]);
	for(int i=1;i<n;i++)for(int j=1;j<=n;j++){
		if(a[i][j]=='o'&&a[i+1][j]=='o'){
			add(id[i][j],id[i+1][j]);
		}
	}
	// for(int i=1;i<=k;i++)debug(i,A[i]);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			bool flag=0;
			To(i,j,k)flag|=a[x][y]=='.';
			if(flag){
				if(a[i][j]=='o'){
					// debug(i,j);
					cnt[id[i][j]]=1;
					is[find(id[i][j])]=1;
				}
			}
		}
	}
	// debug("fa",ary(fa,1,k));
	// debug("siz",ary(siz,1,k));
	// debug("is",ary(is,1,k));
	now=0;
	for(int i=1;i<=k;i++)if(fa[i]==i)now+=!is[i]*siz[i];
	// debug("now",now);
	// debug(A[4]);
	solve1();
	// return;
	solve2();
	int res=0;
	for(int i=1;i<=n;i++){
		// debug(ary(ans[i],1,n));
		for(int j=1;j<=n;j++){
			if(a[i][j]!='.'){
				res=(1ll*res*base+ans[i][j])%mod;
			}
		}
	}
	printf("%d\n",res);
}
void clr(){
	for(int i=1;i<=k;i++)A[i].clear();
	for(int i=1;i<=m;i++)B[i].clear(),cnt[i]=tot[i]=0;
}
int main(){
	for(scanf("%d",&T);T--;clr())get();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 8ms
memory: 95932kb

input:

3
2
.o
..
3
.x.
xoo
ox.
2
oo
oo

output:

0
870527216
485539347

result:

ok 3 number(s): "0 870527216 485539347"

Test #2:

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

input:

2
4
xoxx
oxo.
oo.o
oo.x
6
.o.xox
oox..x
o.xxxo
o..xxo
xxo.o.
xo...o

output:

409509910
370473030

result:

ok 2 number(s): "409509910 370473030"

Test #3:

score: 0
Accepted
time: 8ms
memory: 97860kb

input:

800
2
.o
xx
7
ooo.oox
oo.ooox
.ooxo..
o.oo.oo
x.ooooo
ooxoooo
xoo.ooo
7
oxxxx.o
oxxxoox
x.o.ox.
xoo.xxo
o.oxxox
xxooxxx
oooxxox
4
o.xo
o...
..xo
oxx.
7
ooooxoo
.xoxx.x
xoxoxxx
oxoxoox
xxxxoxx
ooxoxox
ooxoxox
10
x.ox.xxxxo
xoxxooxoox
xxxxoo.ooo
xxxoxxxoxo
xxx.xoooxx
.oxxooxxxo
xxoooxxxxo
oxooxxxoxx
o...

output:

0
249234238
540967184
0
576468701
764482080
0
0
902304782
819328244
160846442
0
352620216
0
0
370473030
668019878
941153329
21426912
663359588
440560176
995720548
1000007
0
0
9889997
214191552
788820559
64395670
120935390
377081136
565792142
295776125
0
135122993
203830701
8109391
158328425
0
0
0
35...

result:

ok 800 numbers

Test #4:

score: 0
Accepted
time: 15ms
memory: 97900kb

input:

500
10
xx...xx.xo
x.x.xx.x..
xx.xo..x..
o.xxx.ooxx
xo...oooxx
.o.ooooxxx
xxxxo.x..x
o.x..o.x.o
xox.x.....
.o.ooxxx.x
10
xxoxxxx.xx
xxoxxx.x.x
x..x.x.xxx
oxxxxxxx..
xxo.x...xx
oxx.o.xx.x
oxxoxxx.x.
xooxx.x..x
.xxoxoxxxx
xo..xxx..x
10
xxxoxx.xx.
....o..x..
....oxox.x
o..x..x...
x..o.x.o..
..x..oxo.o
....

output:

103178655
682777521
0
0
133349536
610720560
71152127
0
248652419
563881446
915343956
44811441
0
239852635
178124065
176299797
0
0
856963352
369873363
837982230
601370956
120027846
257347325
34681532
962413216
687396819
308383519
393303568
195579753
309411244
696835580
300613755
649297673
349292913
5...

result:

ok 500 numbers

Test #5:

score: 0
Accepted
time: 34ms
memory: 99412kb

input:

50
100
.ooooooo.o.ooooo.ooo.x.ooxx..xooxooxoox.ox..oxo.ooooxoo.o...x.o..oxo.oo.....xoo.oo..o...ooo.xo..oooo
o.oo.x.xo.xooxooooo.o..oooxooxoo.oooo.xo.oxx.oxo.oooo..xoooo.ooooo.oooo.xx.ooo.oo..oooo.o.xooo.oxooo
x.ooxo.o.ooooo...oooooxooo.oooxoo.o.ooo..ox.ooo..xooox.o.xoooo.ooooo.xoxooo...o..oo.oo.o.oo...

output:

334375899
974363690
2559871
306504926
41246033
273863549
597561319
467018406
276945413
945810035
717335562
995397123
838621071
44680506
643752788
26235995
866893809
170177484
387259673
117895647
111792
323870998
167866394
722220979
432601870
622682412
229406328
897072072
417354438
285310240
24188202...

result:

ok 50 numbers

Test #6:

score: 0
Accepted
time: 849ms
memory: 180860kb

input:

5
1000
oooooooxoxo.oxoo.oxoooooo.oooxx.o.ooxxoxooo.oxxoxo.xxoooooo.xoox.ooooxooo.ox.ooooooooooooo.oxo.oooo.oooooox..oxoooo.xxxooxooxooooxoooo.xooxo.ooooooooo.xoo..ooooxxx.xooxxoo.oooooooxxoooxoooooxoxooooxxxoxoooxxooooxooxoooox.o.o.oxooxxxoxo.oooooxxoooooxoxxx.o.oxoxoxoox.ooxoxooooooxoo.xxooxoooo.xo...

output:

572746451
535440451
535196357
707383201
22676381

result:

ok 5 number(s): "572746451 535440451 535196357 707383201 22676381"

Test #7:

score: 0
Accepted
time: 260ms
memory: 133340kb

input:

10
262
xxoooxoxxooooxooooxxooooxoo.oxoooxxx.ooooxooxo.xxooxoxoo.xooxoxxoooxooox.xoooooxxoooxxxxx.ooxoooooxxxooxoxooxoxxxooooooooxoxooxxoxxoxooooxoxoooo.xooooo.xoo.xxxo.xxoo.xxxoooooooxooxooxoxooxooxoooxoxxxxxxoxooxoxoxx.oooooooxooox.xooxxxoooxxoxxxo.oxxoxoxooxoxoxooxxo
oooo.xooxoxooxoooxxooxoxooooxx...

output:

642283451
377422271
716465066
994238873
791578692
559154160
219046400
675893326
802853676
745406025

result:

ok 10 numbers

Test #8:

score: 0
Accepted
time: 9ms
memory: 97872kb

input:

500
10
xxxo.xxox.
oox..oxox.
xxxo.xxox.
x.xo..xx..
..........
xxxo.xxxo.
xxxx.xx.x.
xoxx.xxxx.
xxxx.xxxx.
..........
10
.oo..ooo..
o....oo.o.
o.x..o....
oooo..oo..
..........
o..o.o....
xoox.o.oo.
..o...oo..
o..x.oooo.
..........
10
.o....x...
...o......
.....x.xo.
.......o..
..........
xo.o..o...
....

output:

425573033
0
0
0
0
133992286
0
14957338
0
825303110
0
0
838611205
0
47630816
609412080
0
502385852
908019321
760477067
934365459
0
442686806
169316079
0
449991058
0
248974492
471368964
0
0
0
0
96548633
827642260
959216386
366981841
649536401
273659739
0
156012909
0
136775788
0
257252435
997886536
620...

result:

ok 500 numbers

Test #9:

score: 0
Accepted
time: 38ms
memory: 100360kb

input:

50
100
.xxo.xx.x.x.xxoxxxo.x..x.x.ox...x...x.x.xx......x..xo.x.xxx......x.x..xo...x.x..xxoxxxxox.xxxxxxxxx.
x.xx.x.x...oox...xo...xo..ox...xo.x.....x.xxo.x.o.xx.xxxxox......xx.o..xoo..x...o.xo.x.xo.x.o..xo...
.x..x.oxx.o...ox.xx..o...oooo..xoxxx.x...x.x.x.x.......xxx..x..xxox...xx.x.x.x..xx....xx......

output:

826174191
743161530
488249388
305372872
256288104
612268814
71341955
164091870
110136906
796723707
601145811
966958927
682673510
642274559
500901171
0
982464722
614704695
766380241
4382824
19176781
896058532
177343140
965583433
618558610
274592760
550087062
697539883
57503778
824856417
925501822
129...

result:

ok 50 numbers

Test #10:

score: 0
Accepted
time: 322ms
memory: 133992kb

input:

5
1000
.xooxo.xo.xoxxx.xoo....xx.o...xxo.oxx...oxxxo.x.x....xoox.......oox...x.x.....x..oxx.xoox..xo.ox.xx..xo.ooxxo.ox..x..o....oxo.ooo.oo.oxxxx....oooxo.o..xxoxxoox.xo..x.xx..oxooxo.ox..xx.o.xo..x.xx.xxx..x.o.oxx...xoo..xxx..oooxxoxxx.o..oxxxo...oxxxxoxx.oxox..ox..x.xo....o.oxo..o.....xo.oxoxo.ooo...

output:

772108458
592105946
316007691
244295102
691331313

result:

ok 5 number(s): "772108458 592105946 316007691 244295102 691331313"

Test #11:

score: 0
Accepted
time: 569ms
memory: 154104kb

input:

5
1000
o.x..oooxo.ooxoxo..o.oo.xo.o..oo.xxxxxxooxoo.x.o..ox...oooxo.xo.ooo.x.ox....x.o..oo.....xoo..x.o....oox.xxxxoooxoooxx..xox..oo.xxxo.xxoxox.xoxxxxox...oxxxo..x...oxx.o...ooxx.xooo.o.x.xxxx.x.x...xx.ox..xooooo.o...oooxxoo...oo..x...o..xxxox.o..xoxxo...ox..xxxoxx..xx.x..x.ooooxxxo.oxx.oo..ooo.o....

output:

780114096
588882268
370690962
385871818
302680710

result:

ok 5 number(s): "780114096 588882268 370690962 385871818 302680710"

Test #12:

score: 0
Accepted
time: 735ms
memory: 173564kb

input:

5
1000
.oo.o...oxxoxxo.oo.oooooxxoooooox.ooooo.o..xoo.o..oo...o.oooo.o..ooo.xooo.ooox..ooooxo.oooxx.ooxooo.o...ooo.oxooooo.xoxooooxoxo..oooooo.o.ooox.oxox.ooo.oo.o...x.o.oox.ooooooo...oxoooo.oxoo.oo...oooxo.oxo.xoo.oooooooooo...ooooxoxoo.o.ooooo..xxx.o..o..ooo..oxo.ooxo..oooxooxoooooo.oooooo.oooo.oo...

output:

610606331
377709703
636298655
677130621
388172310

result:

ok 5 number(s): "610606331 377709703 636298655 677130621 388172310"

Test #13:

score: 0
Accepted
time: 548ms
memory: 162900kb

input:

5
1000
oo...o.ox..ooxoxooxo.x..xooooxoo.x.oxooo...xoox.oooo.xooo.o..x..xooox.xoooo.ooxoxxoo.o.xo.....xo.oo..x...o.o..xx.oxo..x......o.oo.xoxo..xoxo.ooox..x...x.x.oxxox.oooo.oxxo...x.o...x...xxoxoo.oo.oxoo......o..o.x.ooo.oooo.o.o.ooo.ooooxo..xo.xox.xo.ooooox.xo.ooooo.o.oox..o.o..oxoo...ooo.oo.oooooo...

output:

639899078
654599944
422791417
498274386
976944019

result:

ok 5 number(s): "639899078 654599944 422791417 498274386 976944019"

Test #14:

score: 0
Accepted
time: 669ms
memory: 156052kb

input:

5
1000
xox....xx...ox...x.x....oxx..x..o..o.ox..xox.xo..oxo...o.x..x.ox..o..o.x...x.o.x.ox.xxo..o..o..xxxx...xxxx.xxo..xx....oox.xxx.x...xo..x...xo.o.x.......x.xxo..xxx.x..xxo...xo.x.xx..x.x.x.o.x.x....xo.xxox....x.x...xoo.oxo.....ox...o...x..x..x..ox.o.o..o....x......o..x.....o.o.oxoo....x.xx..oxx....

output:

32778879
896031358
588756562
369206132
506764249

result:

ok 5 number(s): "32778879 896031358 588756562 369206132 506764249"

Test #15:

score: 0
Accepted
time: 548ms
memory: 162716kb

input:

5
1000
oox.o.oo..xoooooo..o.xooox..ooxox.oxx.oooo..o.xoo.o.ox..xoo......xooo..o.xxxoxox...x....oxx.xoxxoooxoxx.oxoo.o.x.oxo.oxxoxo..xx..o.o.oooo.o.o....x.oooo.xoxo.oo....x..xo.oo.oo.oo.oxxxoxxo.xxo.xo.x.xxx..o.o.oooo.xxoxoxooxo....xo.xo.oooxoxxoxxoxooo.ox.o.oo.oo.o.ox...ooooox..o..x...o.xo.x...oxooo...

output:

841683550
137941843
191188635
117557561
456785809

result:

ok 5 number(s): "841683550 137941843 191188635 117557561 456785809"

Test #16:

score: 0
Accepted
time: 563ms
memory: 152464kb

input:

5
1000
oxo.....o...o.xo..ooo..o...xo.ooxoo.ooo..oox.o...x.o.oo..oo.oo.o.o..xoxoo..xoo.o.ooo.o.o.o.xx..oo.....o.oooo.x..xx.ooxo.oo.x..xx..xoo.xooooooooxxoo.o.o.oo...o.oxo.oox..o.oxo.o..oox...o...xo.o..o.o.o.ooxooo...ox.oxoo.ooooxooo...x..o.oox..ox.oo...oo.x.oxoox..x.o.o.....ox.oxx..o......oooo.o.oooo...

output:

900174562
195157973
593744043
69182036
766166480

result:

ok 5 number(s): "900174562 195157973 593744043 69182036 766166480"

Test #17:

score: 0
Accepted
time: 8ms
memory: 95868kb

input:

500
10
xxxxxxxxxx
ooooooxooo
oooooxxoxx
xooooxxoxx
xoxooxxoxx
xxxxxxxoxo
oxxxoxxoxo
oxooooxoxo
oooooooooo
xx.xxxxxxx
10
x.xxxxxxxx
oooooxxxoo
ooxooxxxxo
ooxooxxxxx
xxxxoxxxxx
oxxxxoxxxo
oxxxxoxxxo
ooxxxooxoo
ooxxoooooo
xxx.xxxxxx
10
x...x.xx.x
oooooooxoo
ooxooooxoo
ooxoxooxoo
oxxxxoxxxo
xxoxoxxoxx
o...

output:

30791207
434411883
861450305
805858010
452888831
944267590
613327534
592046697
516629158
559391474
744676155
65281156
258253351
178865181
434658866
439831818
32267021
999877053
236106959
839744459
440355414
767497935
154797784
535141412
925905983
916487041
815086639
675176665
22137530
131253253
9682...

result:

ok 500 numbers

Test #18:

score: 0
Accepted
time: 20ms
memory: 98524kb

input:

100
50
xxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx.
oooooooooooooxoooxoooxoooooooooooxoooxxxoxxooooxoo
ooxooooooooooxoooxoooxooooxooooooxooxxxxoxxooooxoo
ooxooooooooooxoooxoooxooooxoooxooxooxxxxoxxoxooxoo
ooxoxooooooooxoooxoooxooooxoooxooxooxxxxoxxoxooxoo
ooxoxooooooooxoooxoxoxoxooxoooxoxxooxx...

output:

192709039
545741791
693323452
280572014
622738317
319986132
551023123
7301367
753983072
307149312
739641617
418687680
541349731
618840048
586089870
564402163
794335864
961547810
638078130
319636237
592050150
83499286
37751839
963059994
791750358
367029717
354887060
669097112
749616877
835370602
7023...

result:

ok 100 numbers

Test #19:

score: 0
Accepted
time: 39ms
memory: 99684kb

input:

50
100
xxxxxxxxxxxxxxxxxxxxx.xxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xx.xxxxxxxxxxxxx.xxxxxx
oxoooxoooooooooxoooooooooooooxoooooooooooooooooooxooooooxooooooxooxooooooooooxooxooooooooooooooooooo
oxoooxooooooxooxoooooooooooooxoooooooooooooooooooxooooooxooooooxooxooooooooooxooxoooooooooo...

output:

136353153
242903051
842299304
228660358
108966699
660160713
398215129
658167311
861339688
707834421
370355870
733223273
402843179
680446936
215017091
581918110
402999292
419260565
12867971
651430595
841500882
712955796
471121968
877061477
476250757
665396021
473746656
152203437
782103196
56976380
53...

result:

ok 50 numbers

Test #20:

score: 0
Accepted
time: 70ms
memory: 104328kb

input:

25
200
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxx.xxx.xxxxxxxxxxxxxxx.xxxx.xxxxx.xxxxxxxxx.xxxxxxxxxxx.x.xxxxxxxxx..xxxxxxxx.xxxxxxxxxxxxxxx.xxxxxxxxxx
oxooooooooooooooooooxoooxooooooooooooooxooooxooxoooooxooxooxoooxoooooooooooooooooooooxooooxo...

output:

665387810
852862001
194108890
720319580
451941489
600250572
186652802
327387906
969425652
343328133
427229601
583382921
535319227
162240888
257364933
666030752
408922601
15234759
169091210
678109223
109837112
47314838
911725012
578743936
513135858

result:

ok 25 numbers

Test #21:

score: 0
Accepted
time: 166ms
memory: 108232kb

input:

12
400
xx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

377789863
895163399
91372106
241989342
16188050
819942883
300586720
938863211
738590968
810198927
238292645
147322777

result:

ok 12 numbers

Test #22:

score: 0
Accepted
time: 244ms
memory: 125056kb

input:

10
500
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...

output:

258493295
533157442
760003354
659875278
733493742
197053230
684495125
799911128
267454479
366590684

result:

ok 10 numbers

Test #23:

score: 0
Accepted
time: 488ms
memory: 153308kb

input:

6
800
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxx.xxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.x...

output:

389087400
933140150
230452816
440494472
226658918
241413124

result:

ok 6 numbers

Test #24:

score: 0
Accepted
time: 723ms
memory: 171468kb

input:

5
999
x.x.xxx...xxxxx.x.xxxxxxxx..xx..xxx....xx..xx.xxx..xxx.xxx.xxxxxxx.x..xx....xx.x.xxx.xxx.x.x.x.xx.xx.x.x.x.xxxxxxxxxx.x.x..xxxxxx.x.x...xx.xxxxxxxx..xxxxx.x.xx.xx.xx..xxxxxxxxxx.x.xxxxxx.x....x..x.xxx.xx.x.x.x.xx.xx.xx.xx...x.x.x..x..xxx..xxxx.xxxx.xxxxxx.xx.xxx.xx..xx.xx..x...xx...x.x...x.x.x...

output:

867796298
176040560
731044182
993981709
8599440

result:

ok 5 number(s): "867796298 176040560 731044182 993981709 8599440"

Test #25:

score: 0
Accepted
time: 715ms
memory: 169776kb

input:

5
1000
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxx.xxxxxxxxxxxxxxxxxxxxxx...

output:

554875620
803952240
843781212
497461780
583456447

result:

ok 5 number(s): "554875620 803952240 843781212 497461780 583456447"