Submission #3385257
Source Code Expand
var n,i,l,r:Longint; a,v:array[1..100001]of Longint; ans: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; var s,t:int64;i:Longint; begin if(b<0)or(b>a)then begin C:=0; exit; end; s:=1; t:=1; for i:=1 to b do begin s:=s*(a-i+1)mod 1000000007; t:=t*i mod 1000000007; end; C:=s*power(t,1000000005)mod 1000000007; end; begin 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))mod 1000000007); end.
Submission Info
Submission Time | |
---|---|
Task | D - 11 |
User | kotatsugame |
Language | Pascal (FPC 2.6.2) |
Score | 0 |
Code Size | 767 Byte |
Status | TLE |
Exec Time | 2107 ms |
Memory | 1024 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 | 0 / 600 | ||||||
Status |
|
|
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 | TLE | 2103 ms | 1024 KB |
mx.txt | TLE | 2103 ms | 1024 KB |
rnd_0.txt | TLE | 2103 ms | 896 KB |
rnd_1.txt | TLE | 2103 ms | 768 KB |
rnd_2.txt | TLE | 2107 ms | 384 KB |
rnd_3.txt | TLE | 2103 ms | 384 KB |
rnd_4.txt | TLE | 2103 ms | 512 KB |
sample1.txt | AC | 0 ms | 128 KB |
sample2.txt | AC | 0 ms | 128 KB |
sample3.txt | AC | 0 ms | 128 KB |