QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#376066 | #3082. Ascending Matrix | waretle | AC ✓ | 67ms | 10236kb | C++14 | 9.3kb | 2024-04-03 20:16:09 | 2024-04-03 20:16:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int mod=998244353;
int pw(int a,ll b,int c=1)
{
for(;b;b>>=1,a=1ll*a*a%mod)
if(b&1)c=1ll*c*a%mod;
return c;
}
void add(int&a,int b){a+=b;if(a>=mod)a-=mod;}
namespace Poly
{
const int N=1<<18,g=3;
int pwg[N],iinv[N];
int getsz(int n){return 1<<__lg(n)+1;}
void init()
{
for(int h=2;h<=N;h<<=1)
{
int t=pw(3,(mod-1)/h);pwg[h>>1]=1;
for(int i=(h>>1)+1;i<h;++i)pwg[i]=1ll*pwg[i-1]*t%mod;
}
iinv[0]=iinv[1]=1;
for(int i=2;i<N;++i)iinv[i]=1ll*iinv[mod%i]*(mod-mod/i)%mod;
}
void dft(vector<int>&f,int n)
{
f.resize(n);
for(int h=n;h>1;h>>=1)
for(int i=0,p=h>>1;i<n;i+=h)
for(int j=i;j<i+p;++j)
{
int u=f[j],v=f[j+p];
add(f[j],v),f[j+p]=1ll*pwg[j-i+p]*(u-v+mod)%mod;
}
}
void idft(vector<int>&f,int n)
{
f.resize(n);
for(int h=2;h<=n;h<<=1)
for(int i=0,p=h>>1;i<n;i+=h)
for(int j=i;j<i+p;++j)
{
int t=1ll*pwg[j-i+p]*f[j+p]%mod;
f[j+p]=f[j],add(f[j+p],mod-t),add(f[j],t);
}
reverse(f.begin()+1,f.begin()+n);
for(int i=0,k=pw(n,mod-2);i<n;++i)f[i]=1ll*f[i]*k%mod;
}
struct poly:vector<int>
{
using vector<int>::vector;
void modxn(int n){if(n<size())resize(n);}
void drv()
{
for(int i=0;i+1<size();++i)(*this)[i]=1ll*(*this)[i+1]*(i+1)%mod;
pop_back();
}
void itg()
{
push_back(0);
for(int i=size()-1;i>0;--i)(*this)[i]=1ll*(*this)[i-1]*iinv[i]%mod;
(*this)[0]=0;
}
};
poly&operator+=(poly&a,const poly&b)
{
if(a.size()<b.size())a.resize(b.size());
for(int i=0;i<b.size();++i)add(a[i],b[i]);
return a;
}
poly&operator-=(poly&a,const poly&b)
{
if(a.size()<b.size())a.resize(b.size());
for(int i=0;i<b.size();++i)add(a[i],mod-b[i]);
return a;
}
poly operator+(const poly&a,const poly&b)
{
poly c=a;c+=b;return c;
}
poly operator-(const poly&a,const poly&b)
{
poly c=a;c-=b;return c;
}
poly operator*(const poly&a,const poly&b)
{
if(!a.size()||!b.size())return {0};
poly A=a,B=b,C;
int len=getsz(a.size()+b.size()-1);
A.resize(len),B.resize(len),C.resize(len);
dft(A,len),dft(B,len);
for(int i=0;i<len;++i)C[i]=1ll*A[i]*B[i]%mod;
idft(C,len);
return C;
}
poly operator*(int a,const poly&b)
{
poly B=b;
for(int i=0;i<B.size();++i)B[i]=1ll*B[i]*a%mod;
return B;
}
poly operator*(const poly&b,int a)
{
poly B=b;
for(int i=0;i<B.size();++i)B[i]=1ll*B[i]*a%mod;
return B;
}
poly drv(const poly&a)
{
poly A=a;A.drv();return A;
}
poly itg(const poly&a)
{
poly A=a;A.itg();return A;
}
poly modxn(const poly&a,int n)
{
poly A;A.resize(n);for(int i=0;i<n&&i<a.size();++i)A[i]=a[i];return A;
}
poly inv(const poly&A,int n)
{
assert(A[0]);
int cur=1;
poly b;b.resize(1);b[0]=pw(A[0],mod-2);
while(cur<n)
{
cur<<=1;
dft(b,cur*2);
poly a=modxn(A,cur);
dft(a,cur*2);
for(int i=0;i<cur*2;++i)
b[i]=(2*b[i]+1ll*(mod-a[i])*b[i]%mod*b[i])%mod;
idft(b,cur*2);
b.modxn(cur);
}
b.modxn(n);return b;
}
poly ln(const poly&a,int n)
{
assert(a[0]==1);
poly ret=a;ret.drv();
ret=ret*inv(a,n-1);
ret.modxn(n-1),ret.itg();
return ret;
}
poly exp(const poly&a,int n)
{
assert(a[0]==0);
int cur=1;
poly b;b.resize(1);b[0]=1;
while(cur<n)
{
cur<<=1;
b=b*(poly{1}-ln(b,cur)+modxn(a,cur));
b.modxn(cur);
}
return modxn(b,n);
}
poly pow(const poly&a,int n,ll tim)
{
if(a[0])
{
poly b=a*pw(a[0],mod-2);
b=exp(ln(b,n)*(tim%mod),n);
return b*pw(a[0],tim%(mod-1));
}
else assert(0);
}
poly pow_a0_may_be_0(const poly&a,int n,ll tim,bool big=0)
{
if(a[0])return pow(a,n,tim);
if(big)return poly(n,0);
int pos=0;
while(pos<a.size()&&!a[pos])++pos;
if(pos==a.size())return poly(n,0);
if((__int128)tim*pos>=n)return poly(n,0);
poly b;b.resize(n-tim*pos);
for(int i=0;i<b.size()&&i+pos<a.size();++i)
b[i]=a[i+pos];
b=pow(b,n,tim);b.resize(n);
for(int i=n-1;i>=tim*pos;--i)b[i]=b[i-tim*pos];
for(int i=tim*pos-1;i>=0;--i)b[i]=0;
return b;
}
poly sqrt(const poly&a,int n)
{
assert(a[0]==1);
return exp(ln(a,n)*pw(2,mod-2),n);
}
}//namespace Poly
struct matrix
{
int a[105][105];
int det(int n)
{
int res=1;
for(int i=1;i<=n;++i)
{
for(int j=i+1;j<=n;++j)if(j!=i)
{
while(a[i][i])
{
int div=mod-a[j][i]/a[i][i];
for(int k=i;k<=n;++k)
a[j][k]=(a[j][k]+1ll*div*a[i][k])%mod;
swap(a[i],a[j]),res=mod-res;
}
swap(a[i],a[j]),res=mod-res;
}
res=1ll*res*a[i][i]%mod;
}
return res;
}
}A;
int pw(int a,int b=mod-2)
{
int c=1;
for(;b;b>>=1,a=1ll*a*a%mod)
if(b&1)c=1ll*c*a%mod;
return c;
}
struct mint
{
int a;
mint(){a=0;}
mint(int x){a=x%mod;}
void operator+=(mint b){a+=b.a;if(a>=mod)a-=mod;}
mint operator+(mint b)const{mint c=a;c+=b;return c;}
void operator-=(mint b){a+=mod-b.a;if(a>=mod)a-=mod;}
mint operator-(mint b)const{mint c=a;c-=b;return c;}
void operator*=(mint b){a=1ll*a*b.a%mod;}
mint operator*(mint b)const{mint c=a;c*=b;return c;}
void operator/=(mint b){a=1ll*a*pw(b.a)%mod;}
mint operator/(mint b)const{mint c=a;c/=b;return c;}
mint operator-(){mint c=mod-a;if(c.a>=mod)c.a-=mod;return c;}
bool operator==(mint b)const{return a==b.a;}
bool operator!=(mint b)const{return a!=b.a;}
bool operator<(mint b)const{return a<b.a;}
};
mint pw(mint a,int b)
{
mint c=1;
for(;b;b>>=1,a*=a)
if(b&1)c*=a;
return c;
}
namespace old
{
struct poly
{
vector<mint>a;
poly(){a.clear();}
poly(mint x){a.resize(1);a[0]=x;}
poly(vector<mint>x){a=x;}
mint&operator[](int x){if(a.size()<=x)a.resize(x+1);return a[x];}
int size()const{return a.size();}
void resize(int x){a.resize(x);}
void operator+=(poly b)
{
if(b.size()>a.size())a.resize(b.size());
for(int i=0;i<b.size();++i)a[i]+=b[i];
}
poly operator+(poly b){poly c=*this;c+=b;return c;}
void operator-=(poly b)
{
if(b.size()>a.size())a.resize(b.size());
for(int i=0;i<b.size();++i)a[i]-=b[i];
}
poly operator-(poly b){poly c=*this;c-=b;return c;}
poly operator*(poly b)
{
poly c;c.resize(a.size()+b.size()-1);
for(int i=0;i<a.size();++i)
for(int j=0;j<b.size();++j)
c[i+j]+=a[i]*b[j];
return c;
}
void operator*=(mint b)
{
for(auto&i:a)i*=b;
}
poly operator*(mint b){poly c=*this;c*=b;return c;}
poly operator/(mint b){b=pw(b.a);return *this*b;}
void operator/=(mint b){b=pw(b.a);*this*=b;}
poly operator/(poly b)
{
poly a=*this;
assert(b.size()==2);
mint x=mint(1)/b[1];
poly c;c.resize(a.size()-1);
for(int i=a.size()-1;i;--i)
c[i-1]=a[i]*x,a[i-1]-=c[i-1]*b[0];
return c;
}
poly operator<<(int b)
{
poly c;c.resize(a.size()+b);
for(int i=0;i<a.size();++i)c[i+b]=a[i];
return c;
}
mint operator()(mint x)
{
mint cur=1,res=0;
for(int i=0;i<a.size();++i)
res+=cur*a[i],cur*=x;
return res;
}
};
struct point{mint x,y;point(mint a=0,mint b=0){x=a,y=b;}};
poly interpolate(const vector<point>&vec)
{
poly all(mint(1)),sum;
for(auto i:vec)
all=all*poly({-i.x,mint(1)});
for(auto i:vec)
{
mint den=1;
for(auto j:vec)if(i.x!=j.x)den*=i.x-j.x;
sum+=all/poly({-i.x,mint(1)})/den*i.y;
}
return sum;
}
}//namespace old
int C[1005][1005];
pair<int,int>wys[105][105];
int calc(int x,int y){if(x<0||y<0)return 0;return C[x+y][x];}
int main()
{
Poly::init();
for(int i=0;i<=1000;++i)
{
C[i][0]=1;
for(int j=1;j<=i;++j)C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
}
int n,m,k,r,c,v;scanf("%d%d%d%d%d%d",&n,&m,&k,&r,&c,&v);
r+=v-1,c+=v-1;
for(int i=1;i<k;++i)for(int j=1;j<k;++j)
{
int sx=n+i,sy=i,tx=j,ty=m+j;
if(r>sx||c>ty){wys[i][j].first=calc(sx-tx,ty-sy);continue;}
if(r<tx||c<sy){wys[i][j].second=calc(sx-tx,ty-sy);continue;}
wys[i][j].second=(calc(sx-tx,ty-sy)+1ll*(mod-calc(sx-r,c-sy))*calc(r-tx,ty-c))%mod;
for(int p=tx;p<r;++p)
{
int tmp=1ll*calc(sx-p,c-1-sy)*calc(p-tx,ty-c)%mod;
add(wys[i][j].first,tmp),add(wys[i][j].second,mod-tmp);
}
}
vector<old::point>vec;
for(int i=1;i<=k;++i)
{
for(int x=1;x<k;++x)for(int y=1;y<k;++y)
A.a[x][y]=(1ll*i*wys[x][y].first+wys[x][y].second)%mod;
vec.push_back({i,A.det(k-1)});
}
old::poly res=old::interpolate(vec);
printf("%d\n",res[v-1].a);
}
詳細信息
Test #1:
score: 100
Accepted
time: 11ms
memory: 9928kb
input:
148 129 48 144 105 13
output:
467058311
result:
ok single line: '467058311'
Test #2:
score: 0
Accepted
time: 0ms
memory: 9868kb
input:
57 48 11 56 9 1
output:
951177245
result:
ok single line: '951177245'
Test #3:
score: 0
Accepted
time: 22ms
memory: 9896kb
input:
121 146 72 117 72 25
output:
284798523
result:
ok single line: '284798523'
Test #4:
score: 0
Accepted
time: 4ms
memory: 9908kb
input:
66 142 11 51 124 4
output:
542285716
result:
ok single line: '542285716'
Test #5:
score: 0
Accepted
time: 65ms
memory: 9936kb
input:
45 127 98 3 31 80
output:
116902187
result:
ok single line: '116902187'
Test #6:
score: 0
Accepted
time: 6ms
memory: 9904kb
input:
125 199 45 51 91 21
output:
715355617
result:
ok single line: '715355617'
Test #7:
score: 0
Accepted
time: 4ms
memory: 9864kb
input:
41 153 6 6 147 2
output:
190519561
result:
ok single line: '190519561'
Test #8:
score: 0
Accepted
time: 23ms
memory: 9928kb
input:
112 108 69 99 29 47
output:
481688971
result:
ok single line: '481688971'
Test #9:
score: 0
Accepted
time: 56ms
memory: 9976kb
input:
138 99 94 73 43 73
output:
667469005
result:
ok single line: '667469005'
Test #10:
score: 0
Accepted
time: 0ms
memory: 9868kb
input:
143 147 18 24 141 9
output:
763965115
result:
ok single line: '763965115'
Test #11:
score: 0
Accepted
time: 61ms
memory: 10004kb
input:
99 63 97 78 51 66
output:
130195301
result:
ok single line: '130195301'
Test #12:
score: 0
Accepted
time: 4ms
memory: 9920kb
input:
103 23 10 25 7 4
output:
674555733
result:
ok single line: '674555733'
Test #13:
score: 0
Accepted
time: 5ms
memory: 10140kb
input:
137 194 42 125 104 17
output:
416667361
result:
ok single line: '416667361'
Test #14:
score: 0
Accepted
time: 7ms
memory: 9868kb
input:
191 13 37 42 2 21
output:
530754407
result:
ok single line: '530754407'
Test #15:
score: 0
Accepted
time: 12ms
memory: 10188kb
input:
195 33 53 101 29 32
output:
851306824
result:
ok single line: '851306824'
Test #16:
score: 0
Accepted
time: 0ms
memory: 9844kb
input:
84 173 8 70 70 6
output:
25135799
result:
ok single line: '25135799'
Test #17:
score: 0
Accepted
time: 10ms
memory: 10184kb
input:
39 53 49 37 6 9
output:
640044940
result:
ok single line: '640044940'
Test #18:
score: 0
Accepted
time: 22ms
memory: 9900kb
input:
135 129 68 134 86 16
output:
910022919
result:
ok single line: '910022919'
Test #19:
score: 0
Accepted
time: 13ms
memory: 9948kb
input:
62 74 56 28 12 46
output:
774987233
result:
ok single line: '774987233'
Test #20:
score: 0
Accepted
time: 36ms
memory: 9924kb
input:
87 135 81 27 44 58
output:
629485683
result:
ok single line: '629485683'
Test #21:
score: 0
Accepted
time: 9ms
memory: 9936kb
input:
148 199 44 79 81 40
output:
369408819
result:
ok single line: '369408819'
Test #22:
score: 0
Accepted
time: 0ms
memory: 9900kb
input:
18 195 5 17 151 5
output:
198068951
result:
ok single line: '198068951'
Test #23:
score: 0
Accepted
time: 25ms
memory: 10216kb
input:
200 137 75 67 65 74
output:
864017958
result:
ok single line: '864017958'
Test #24:
score: 0
Accepted
time: 15ms
memory: 9912kb
input:
171 162 56 113 97 30
output:
255341800
result:
ok single line: '255341800'
Test #25:
score: 0
Accepted
time: 7ms
memory: 10132kb
input:
8 134 38 1 93 10
output:
282048962
result:
ok single line: '282048962'
Test #26:
score: 0
Accepted
time: 53ms
memory: 9896kb
input:
13 55 93 3 25 40
output:
852404927
result:
ok single line: '852404927'
Test #27:
score: 0
Accepted
time: 9ms
memory: 10172kb
input:
169 157 42 77 108 39
output:
595819517
result:
ok single line: '595819517'
Test #28:
score: 0
Accepted
time: 44ms
memory: 10008kb
input:
41 199 87 18 82 58
output:
698977796
result:
ok single line: '698977796'
Test #29:
score: 0
Accepted
time: 15ms
memory: 9904kb
input:
190 68 57 188 59 15
output:
46174623
result:
ok single line: '46174623'
Test #30:
score: 0
Accepted
time: 35ms
memory: 10200kb
input:
90 52 71 39 41 23
output:
417181087
result:
ok single line: '417181087'
Test #31:
score: 0
Accepted
time: 46ms
memory: 9944kb
input:
108 76 89 55 40 13
output:
210578964
result:
ok single line: '210578964'
Test #32:
score: 0
Accepted
time: 5ms
memory: 9884kb
input:
166 191 27 102 30 11
output:
365224233
result:
ok single line: '365224233'
Test #33:
score: 0
Accepted
time: 4ms
memory: 9860kb
input:
41 166 4 10 49 2
output:
245797147
result:
ok single line: '245797147'
Test #34:
score: 0
Accepted
time: 28ms
memory: 9996kb
input:
135 128 79 44 16 6
output:
203896980
result:
ok single line: '203896980'
Test #35:
score: 0
Accepted
time: 26ms
memory: 9880kb
input:
101 193 79 43 65 75
output:
27637457
result:
ok single line: '27637457'
Test #36:
score: 0
Accepted
time: 8ms
memory: 9908kb
input:
88 81 53 35 54 47
output:
950708598
result:
ok single line: '950708598'
Test #37:
score: 0
Accepted
time: 0ms
memory: 9940kb
input:
87 40 28 37 8 8
output:
817953396
result:
ok single line: '817953396'
Test #38:
score: 0
Accepted
time: 55ms
memory: 9932kb
input:
193 136 94 12 94 23
output:
145619900
result:
ok single line: '145619900'
Test #39:
score: 0
Accepted
time: 20ms
memory: 9928kb
input:
90 183 67 8 171 26
output:
899333159
result:
ok single line: '899333159'
Test #40:
score: 0
Accepted
time: 3ms
memory: 9896kb
input:
107 178 32 24 103 12
output:
82019799
result:
ok single line: '82019799'
Test #41:
score: 0
Accepted
time: 16ms
memory: 9916kb
input:
160 23 61 60 17 3
output:
350971684
result:
ok single line: '350971684'
Test #42:
score: 0
Accepted
time: 0ms
memory: 9860kb
input:
100 176 10 54 58 4
output:
978823166
result:
ok single line: '978823166'
Test #43:
score: 0
Accepted
time: 5ms
memory: 9880kb
input:
181 183 42 7 91 41
output:
690262327
result:
ok single line: '690262327'
Test #44:
score: 0
Accepted
time: 10ms
memory: 9860kb
input:
105 131 47 53 68 33
output:
806603020
result:
ok single line: '806603020'
Test #45:
score: 0
Accepted
time: 67ms
memory: 9952kb
input:
51 10 100 1 5 73
output:
341852925
result:
ok single line: '341852925'
Test #46:
score: 0
Accepted
time: 22ms
memory: 10212kb
input:
87 198 73 75 109 72
output:
741170008
result:
ok single line: '741170008'
Test #47:
score: 0
Accepted
time: 5ms
memory: 10144kb
input:
25 158 13 22 1 1
output:
237363061
result:
ok single line: '237363061'
Test #48:
score: 0
Accepted
time: 24ms
memory: 9948kb
input:
64 112 71 28 109 10
output:
350168232
result:
ok single line: '350168232'
Test #49:
score: 0
Accepted
time: 11ms
memory: 10188kb
input:
143 191 52 10 98 10
output:
71885894
result:
ok single line: '71885894'
Test #50:
score: 0
Accepted
time: 3ms
memory: 9836kb
input:
30 130 36 22 85 6
output:
909971212
result:
ok single line: '909971212'
Test #51:
score: 0
Accepted
time: 7ms
memory: 10164kb
input:
154 136 38 34 109 15
output:
655764791
result:
ok single line: '655764791'
Test #52:
score: 0
Accepted
time: 2ms
memory: 9868kb
input:
13 112 7 9 55 1
output:
623849663
result:
ok single line: '623849663'
Test #53:
score: 0
Accepted
time: 9ms
memory: 9908kb
input:
137 103 47 56 77 35
output:
43033659
result:
ok single line: '43033659'
Test #54:
score: 0
Accepted
time: 0ms
memory: 10116kb
input:
40 17 37 11 7 15
output:
803046927
result:
ok single line: '803046927'
Test #55:
score: 0
Accepted
time: 14ms
memory: 9896kb
input:
166 14 58 49 1 26
output:
664593299
result:
ok single line: '664593299'
Test #56:
score: 0
Accepted
time: 0ms
memory: 9892kb
input:
88 195 15 10 120 5
output:
925522664
result:
ok single line: '925522664'
Test #57:
score: 0
Accepted
time: 57ms
memory: 9920kb
input:
164 166 96 161 138 32
output:
111053370
result:
ok single line: '111053370'
Test #58:
score: 0
Accepted
time: 51ms
memory: 9896kb
input:
145 135 94 68 83 9
output:
394110532
result:
ok single line: '394110532'
Test #59:
score: 0
Accepted
time: 17ms
memory: 9876kb
input:
154 173 63 5 77 51
output:
540440686
result:
ok single line: '540440686'
Test #60:
score: 0
Accepted
time: 5ms
memory: 9864kb
input:
20 91 30 20 83 17
output:
961395776
result:
ok single line: '961395776'
Test #61:
score: 0
Accepted
time: 5ms
memory: 9876kb
input:
144 39 13 77 9 5
output:
99731481
result:
ok single line: '99731481'
Test #62:
score: 0
Accepted
time: 38ms
memory: 9912kb
input:
87 152 83 4 59 81
output:
139490896
result:
ok single line: '139490896'
Test #63:
score: 0
Accepted
time: 44ms
memory: 9884kb
input:
171 135 89 114 124 10
output:
736020363
result:
ok single line: '736020363'
Test #64:
score: 0
Accepted
time: 60ms
memory: 9976kb
input:
82 41 99 66 6 5
output:
882042301
result:
ok single line: '882042301'
Test #65:
score: 0
Accepted
time: 6ms
memory: 10176kb
input:
33 114 28 11 73 11
output:
653378940
result:
ok single line: '653378940'
Test #66:
score: 0
Accepted
time: 0ms
memory: 9828kb
input:
180 73 10 43 63 9
output:
170492767
result:
ok single line: '170492767'
Test #67:
score: 0
Accepted
time: 18ms
memory: 9856kb
input:
33 185 63 19 107 7
output:
907253908
result:
ok single line: '907253908'
Test #68:
score: 0
Accepted
time: 5ms
memory: 10120kb
input:
69 90 22 34 31 3
output:
137223161
result:
ok single line: '137223161'
Test #69:
score: 0
Accepted
time: 6ms
memory: 10196kb
input:
42 45 60 29 38 36
output:
99908563
result:
ok single line: '99908563'
Test #70:
score: 0
Accepted
time: 7ms
memory: 10172kb
input:
69 158 34 56 39 17
output:
681472254
result:
ok single line: '681472254'
Test #71:
score: 0
Accepted
time: 38ms
memory: 9940kb
input:
66 69 84 5 8 41
output:
277373736
result:
ok single line: '277373736'
Test #72:
score: 0
Accepted
time: 21ms
memory: 10200kb
input:
168 31 68 66 4 21
output:
528816013
result:
ok single line: '528816013'
Test #73:
score: 0
Accepted
time: 55ms
memory: 10236kb
input:
65 33 94 2 30 76
output:
331224077
result:
ok single line: '331224077'
Test #74:
score: 0
Accepted
time: 4ms
memory: 9872kb
input:
84 111 12 28 106 12
output:
95279945
result:
ok single line: '95279945'
Test #75:
score: 0
Accepted
time: 33ms
memory: 9884kb
input:
102 77 83 95 62 51
output:
773914979
result:
ok single line: '773914979'
Test #76:
score: 0
Accepted
time: 25ms
memory: 9920kb
input:
113 144 76 24 68 13
output:
845242590
result:
ok single line: '845242590'
Test #77:
score: 0
Accepted
time: 0ms
memory: 9868kb
input:
45 24 9 10 2 5
output:
71790514
result:
ok single line: '71790514'
Test #78:
score: 0
Accepted
time: 17ms
memory: 10148kb
input:
158 98 61 86 50 29
output:
123475901
result:
ok single line: '123475901'
Test #79:
score: 0
Accepted
time: 0ms
memory: 9868kb
input:
118 52 27 11 23 21
output:
489202572
result:
ok single line: '489202572'
Test #80:
score: 0
Accepted
time: 3ms
memory: 9912kb
input:
122 148 35 112 17 17
output:
856169627
result:
ok single line: '856169627'
Test #81:
score: 0
Accepted
time: 5ms
memory: 9888kb
input:
135 114 15 20 43 9
output:
873320383
result:
ok single line: '873320383'
Test #82:
score: 0
Accepted
time: 35ms
memory: 9940kb
input:
89 70 84 70 12 18
output:
302990320
result:
ok single line: '302990320'
Test #83:
score: 0
Accepted
time: 20ms
memory: 9880kb
input:
15 68 67 5 51 66
output:
980298686
result:
ok single line: '980298686'
Test #84:
score: 0
Accepted
time: 21ms
memory: 9868kb
input:
50 2 73 40 2 8
output:
550497760
result:
ok single line: '550497760'
Test #85:
score: 0
Accepted
time: 34ms
memory: 10216kb
input:
117 88 83 93 1 50
output:
645491986
result:
ok single line: '645491986'
Test #86:
score: 0
Accepted
time: 8ms
memory: 9900kb
input:
45 173 54 34 93 3
output:
330947509
result:
ok single line: '330947509'
Test #87:
score: 0
Accepted
time: 5ms
memory: 9844kb
input:
39 10 22 34 6 20
output:
184357429
result:
ok single line: '184357429'
Test #88:
score: 0
Accepted
time: 24ms
memory: 10204kb
input:
58 27 71 55 19 22
output:
201813851
result:
ok single line: '201813851'
Test #89:
score: 0
Accepted
time: 7ms
memory: 9952kb
input:
123 57 40 14 38 23
output:
891805630
result:
ok single line: '891805630'
Test #90:
score: 0
Accepted
time: 19ms
memory: 9924kb
input:
84 64 70 12 2 23
output:
351372969
result:
ok single line: '351372969'
Test #91:
score: 0
Accepted
time: 25ms
memory: 9924kb
input:
46 160 72 21 146 9
output:
625614461
result:
ok single line: '625614461'
Test #92:
score: 0
Accepted
time: 13ms
memory: 10192kb
input:
45 99 57 25 40 4
output:
498175745
result:
ok single line: '498175745'
Test #93:
score: 0
Accepted
time: 5ms
memory: 10116kb
input:
15 21 12 14 6 3
output:
727195216
result:
ok single line: '727195216'
Test #94:
score: 0
Accepted
time: 6ms
memory: 10004kb
input:
154 77 32 73 62 15
output:
513610382
result:
ok single line: '513610382'
Test #95:
score: 0
Accepted
time: 5ms
memory: 10160kb
input:
165 97 16 158 69 11
output:
308621770
result:
ok single line: '308621770'
Test #96:
score: 0
Accepted
time: 62ms
memory: 9944kb
input:
146 128 97 132 24 10
output:
751957330
result:
ok single line: '751957330'
Test #97:
score: 0
Accepted
time: 3ms
memory: 10172kb
input:
49 39 35 2 10 14
output:
338882448
result:
ok single line: '338882448'
Test #98:
score: 0
Accepted
time: 21ms
memory: 9892kb
input:
73 1 73 35 1 44
output:
126891463
result:
ok single line: '126891463'
Test #99:
score: 0
Accepted
time: 12ms
memory: 9856kb
input:
69 82 59 1 73 1
output:
436743471
result:
ok single line: '436743471'
Test #100:
score: 0
Accepted
time: 7ms
memory: 9844kb
input:
88 86 40 19 77 4
output:
758000538
result:
ok single line: '758000538'