Submission #3385272


Source Code Expand

var
	n,i,l,r:Longint;
	a,v:array[1..100001]of Longint;
	ans:int64;
	fac:array[0..100001]of int64;
function power(a,b:int64):int64;
var s:int64;
begin
	if b=0 then power:=1
	else begin
		s:=power(a*a mod 1000000007,b div 2);
		if b mod 2=1 then s:=s*a mod 1000000007;
		power:=s;
	end;
end;
function C(a,b:int64):int64;
begin
	if(b<0)or(b>a)then begin
		C:=0;
		exit;
	end;
	C:=fac[a]*power(fac[a-b],1000000005)mod 1000000007*power(fac[b],1000000005)mod 1000000007;
end;
begin
	fac[0]:=1;
	for i:=1 to 100001 do fac[i]:=fac[i-1]*i mod 1000000007;
	read(n);
	for i:=1 to n+1 do begin
		read(a[i]);
		if v[a[i]]=0 then v[a[i]]:=i
		else begin
			l:=v[a[i]]-1;
			r:=n+1-i;
		end;
	end;
	for i:=1 to n+1 do writeln((C(n+1,i)-C(l+r,i-1)+1000000007)mod 1000000007);
end.

Submission Info

Submission Time
Task D - 11
User kotatsugame
Language Pascal (FPC 2.6.2)
Score 600
Code Size 802 Byte
Status AC
Exec Time 420 ms
Memory 2560 KB

Compile Error

/usr/bin/ld.bfd: warning: ./link.res contains output sections; did you forget -T?

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 600 / 600
Status
AC × 3
AC × 10
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All 1.txt, mx.txt, rnd_0.txt, rnd_1.txt, rnd_2.txt, rnd_3.txt, rnd_4.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt AC 420 ms 2560 KB
mx.txt AC 229 ms 2560 KB
rnd_0.txt AC 293 ms 2304 KB
rnd_1.txt AC 209 ms 2048 KB
rnd_2.txt AC 82 ms 1280 KB
rnd_3.txt AC 71 ms 1152 KB
rnd_4.txt AC 81 ms 1408 KB
sample1.txt AC 2 ms 896 KB
sample2.txt AC 2 ms 896 KB
sample3.txt AC 2 ms 896 KB