QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#782791 | #9438. Two Box | strlen_s_ | AC ✓ | 1935ms | 223448kb | C++17 | 4.4kb | 2024-11-25 21:28:05 | 2024-11-25 21:28:07 |
Judging History
answer
#include<bits/stdc++.h>
#define ls (k<<1)
#define rs (k<<1|1)
#define mid (l+r>>1)
#define ll long long
using namespace std;
const int M=3e4+10,N=16,mod=998244353,inv2=499122177,B=15;
ll C[N][N],ivC[N][N];
ll xs[N][N][N];
int n,m,q;
ll pw[N];
ll dp[M][N][N];
int a[M];
struct node{
ll c[N];
void init(int len){
memset(c,0,sizeof(c));
for(int i=0;i<=len;i++)c[i]=1;
}
};
node merge(node a,node b,int len){
for(int i=0;i<=len;i++)a.c[i]=a.c[i]*b.c[i]%mod;
return a;
}
struct segtree{
node v[M<<2];
int cnt[M<<2],sm[M<<2];
int ik;
void pushup(int k){v[k]=merge(v[ls],v[rs],ik),cnt[k]=cnt[ls]+cnt[rs],sm[k]=sm[ls]+sm[rs];}
void build(int k,int l,int r){
cnt[k]=r-l+1;v[k].init(ik);
if(l==r)return;
build(ls,l,mid),build(rs,mid+1,r);
}
void upd(int k,int l,int r,int x,node z,int z2,int z3){
if(x>n)return;
if(l==r){v[k]=z,cnt[k]+=z2,sm[k]=z3;return;}
if(mid>=x)upd(ls,l,mid,x,z,z2,z3);
else upd(rs,mid+1,r,x,z,z2,z3);
pushup(k);
}
void qry(int k,int l,int r,int x,int y,node &ans,int &sum){
if(x<=l&&r<=y){
ans=merge(ans,v[k],ik);
sum+=sm[k];
return;
}
if(mid>=x)qry(ls,l,mid,x,y,ans,sum);
if(y>mid)qry(rs,mid+1,r,x,y,ans,sum);
}
int findl(int k,int l,int r,int x){
if(x<1)return 0;
if(!cnt[k])return 0;
if(l==r)return l+1;
if(mid>=x)return findl(ls,l,mid,x);
int p=findl(rs,mid+1,r,x);
if(p)return p;
return findl(ls,l,mid,x);
}
int findr(int k,int l,int r,int x){
if(x>n)return n+1;
if(!cnt[k])return n+1;
if(l==r)return r;
if(mid>=x){
int p=findr(ls,l,mid,x);
if(p!=n+1)return p;
return findr(rs,mid+1,r,x);
}
return findr(rs,mid+1,r,x);
}
}T[N];
ll ksm(ll a,int b){
ll res=1;
while(b){
if(b&1)res=res*a%mod;
a=a*a%mod,b>>=1;
}
return res;
}
void init(){
C[0][0]=1;
for(int i=1;i<=B;i++){
C[i][0]=1;
for(int j=1;j<=i;j++)
C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
}
for(int i=0;i<=B;i++)
for(int j=0;j<=i;j++)
ivC[i][j]=ksm(C[i][j],mod-2);
for(int i=0;i<=B;i++)dp[0][i][0]=1;
for(int i=1;i<=3e4;i++)
for(int j=0;j<=B;j++)
for(int k=0;k<=j;k++)
dp[i][j][k]=((k+1<=j?dp[i-1][j][k+1]*(k+1):0)+(k?dp[i-1][j][k-1]*(j-k+1):0))%mod;
for(int i=0;i<=3e4;i++)
for(int j=0;j<=B;j++)
for(int k=0;k<=j;k++)
dp[i][j][k]=dp[i][j][k]*ivC[j][k]%mod;
for(int l=0;l<=B;l++)
for(int i=0;i<=l;i++)
for(int j=0;j<=l;j++)
for(int k=0;k<=min(i,j);k++)
xs[l][i][j]=(xs[l][i][j]+((k&1)?mod-1:1)*C[i][k]%mod*C[l-i][j-k])%mod;
pw[0]=1;
for(int i=1;i<=B;i++)pw[i]=pw[i-1]*inv2%mod;
}
void FWT(ll *c,int len,ll z){
ll rec[N]={0};
for(int i=0;i<=len;i++)
for(int j=0;j<=len;j++)
rec[i]=(rec[i]+c[j]*xs[len][i][j]%mod*z)%mod;
for(int i=0;i<=len;i++)c[i]=rec[i];
}
void mdf(int k,int p){
if(p<1||p>n)return;
int l=max(T[k].findl(1,1,n,p),1),tr=T[k].findr(1,1,n,p),r=min(tr,n),len=r-l+1;
if(l>r)return;
node z;z.init(k);
T[k].upd(1,1,n,p+1,z,0,0);
if(k==m){
for(int i=0;i<=k;i++)z.c[i]=dp[len][k][i];
if(tr==n+1)for(int i=0;i<k;i++)z.c[i]=(z.c[i]+z.c[i+1])%mod;
z.c[k]=0;
FWT(z.c,k-1,1);
T[k].upd(1,1,n,l,z,0,r-l+1);
return;
}
node ans;ans.init(k);int sum=0;
T[k+1].qry(1,1,n,l,r,ans,sum);
len-=sum;
for(int i=0;i<=k;i++)z.c[i]=dp[len][k][i];
FWT(z.c,k,1);
for(int i=0;i<=k;i++)z.c[i]=z.c[i]*ans.c[i]%mod;
FWT(z.c,k,pw[k]);
if(tr==n+1)for(int i=0;i<k;i++)z.c[i]=(z.c[i]+z.c[i+1])%mod;
z.c[k]=0;
FWT(z.c,k-1,1);
T[k].upd(1,1,n,l,z,0,r-l+1);
}
void upd(int p,int z){
if(a[p]==z)return;
node c;
if(a[p]<z){
for(int i=z;i>a[p];i--){
c.init(i-1);
T[i].upd(1,1,n,p,c,-1,0);
mdf(i,p);
}
}
else{
for(int i=a[p];i>z;i--){
c.init(i-1);
T[i].upd(1,1,n,p,c,1,0);
mdf(i,p-1),mdf(i,p+1);
}
}
for(int i=min(a[p],z);i>=2;i--)mdf(i,p);
a[p]=z;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
init();
cin>>n>>m>>q;
for(int i=2;i<=m;i++)T[i].ik=i-1,T[i].build(1,1,n);
for(int i=1;i<=n;i++)a[i]=1;
for(int i=1,x;i<=n;i++){
cin>>x;
upd(i,x);
}
while(q--){
int p,x;
cin>>p>>x;
upd(p,x);
if(m==1)cout<<1<<'\n';
else cout<<T[2].v[1].c[0]<<'\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 11ms
memory: 73372kb
input:
3 3 2 1 3 1 3 2 1 3
output:
5 14
result:
ok 2 tokens
Test #2:
score: 0
Accepted
time: 9ms
memory: 87892kb
input:
6 8 1 3 8 7 7 1 6 1 4
output:
2100
result:
ok "2100"
Test #3:
score: 0
Accepted
time: 10ms
memory: 94324kb
input:
12 10 8 1 3 2 6 3 6 7 7 5 5 4 7 12 4 7 10 4 2 9 8 9 9 8 3 4 9 10 2
output:
2741280 3007680 1503840 1916160 1972800 728640 1821600 621440
result:
ok 8 tokens
Test #4:
score: 0
Accepted
time: 20ms
memory: 80312kb
input:
1939 5 1 5 1 1 2 1 5 4 5 3 1 2 1 3 3 1 2 3 5 5 3 2 2 1 3 1 5 1 4 2 5 4 1 5 4 3 4 5 3 3 3 3 2 1 2 3 5 1 4 2 1 4 1 3 5 2 2 1 4 4 5 3 2 3 2 1 1 5 5 5 5 3 4 3 1 3 1 1 1 3 5 3 5 1 5 4 3 2 1 2 2 2 3 5 2 4 2 3 1 2 5 5 1 2 5 2 5 3 3 3 4 5 1 5 4 5 3 3 5 4 5 3 5 3 2 2 5 3 2 4 3 3 4 2 2 1 3 1 3 5 2 3 4 2 3 2 4...
output:
894246250
result:
ok "894246250"
Test #5:
score: 0
Accepted
time: 16ms
memory: 88380kb
input:
245 9 1 2 2 3 6 7 5 7 4 7 9 7 6 3 1 6 8 2 1 1 5 3 1 1 3 1 6 8 4 8 4 8 1 8 6 6 9 3 4 7 1 5 2 3 9 5 7 5 7 7 5 5 5 5 1 5 4 7 1 2 6 8 9 5 4 1 8 6 3 9 9 1 3 6 5 5 5 1 6 5 1 2 5 5 4 1 1 8 3 8 2 9 7 9 5 7 8 8 5 9 1 1 4 4 9 9 6 3 9 8 9 2 1 2 6 9 2 1 3 7 3 2 5 9 3 7 2 2 3 4 7 5 1 8 5 8 6 7 9 7 4 8 7 2 2 7 5 ...
output:
99945033
result:
ok "99945033"
Test #6:
score: 0
Accepted
time: 23ms
memory: 95012kb
input:
1919 9 1 7 1 7 6 6 9 8 5 1 8 9 9 7 3 4 2 8 9 4 8 7 4 8 8 8 4 2 9 5 9 3 7 2 3 2 8 7 9 1 1 3 7 7 2 5 9 2 1 3 6 7 6 4 4 1 9 3 7 3 2 5 5 1 4 7 8 6 2 1 4 7 1 4 7 4 7 6 3 8 4 3 7 3 1 7 5 2 2 2 4 9 1 5 5 7 7 3 1 5 4 7 2 9 5 4 9 3 2 6 8 2 3 8 3 6 5 5 5 9 7 2 8 2 9 5 1 8 6 3 1 2 9 1 9 1 3 9 6 7 2 3 2 2 7 9 7...
output:
292474819
result:
ok "292474819"
Test #7:
score: 0
Accepted
time: 19ms
memory: 81412kb
input:
1985 5 1 1 5 5 1 4 4 3 2 1 4 4 1 1 2 5 5 5 3 3 1 2 4 3 3 5 5 2 4 1 1 5 4 3 1 2 5 5 4 1 5 2 5 2 4 1 4 5 1 3 4 4 2 2 4 5 2 1 5 5 3 2 5 5 2 4 4 5 2 5 1 1 5 5 1 1 3 4 2 4 5 2 1 2 1 1 2 3 5 1 5 2 4 1 5 3 2 2 3 1 3 4 5 1 4 4 2 4 3 5 5 1 4 3 4 5 5 2 5 2 2 2 2 2 3 5 1 4 4 3 3 4 5 5 4 3 5 1 4 5 5 2 3 2 2 3 3...
output:
810807913
result:
ok "810807913"
Test #8:
score: 0
Accepted
time: 11ms
memory: 79216kb
input:
357 5 1 1 3 2 5 4 4 3 4 3 1 1 1 4 5 5 2 1 3 4 1 3 1 2 3 4 1 5 3 1 3 5 1 4 4 2 4 5 1 3 4 2 5 2 3 2 5 3 2 2 1 4 3 1 1 2 3 2 3 2 1 4 4 5 5 1 4 2 1 2 2 2 4 1 3 5 1 1 2 4 4 5 4 1 2 4 1 2 3 2 4 3 4 3 4 1 4 1 1 4 5 4 4 4 3 2 5 4 5 4 2 4 1 2 5 5 3 5 5 2 4 2 1 2 1 4 1 2 1 3 1 5 2 2 1 5 2 2 4 5 1 3 4 5 3 3 3 ...
output:
836628563
result:
ok "836628563"
Test #9:
score: 0
Accepted
time: 12ms
memory: 96372kb
input:
858 10 1 1 9 2 9 6 9 6 10 9 4 1 9 7 7 9 2 5 6 9 3 4 7 4 2 5 10 8 10 4 8 8 1 2 9 10 9 5 9 1 2 1 8 10 2 8 1 10 6 9 5 2 4 9 4 1 5 6 10 7 5 1 7 6 7 9 8 4 4 1 8 1 4 4 10 8 10 1 1 1 2 6 3 6 9 8 10 4 5 8 3 6 7 2 9 9 7 9 10 5 7 4 9 4 7 3 1 10 2 6 4 1 5 8 7 1 6 1 2 8 8 1 3 6 8 5 3 10 9 8 4 8 5 2 2 2 10 8 1 8...
output:
699591879
result:
ok "699591879"
Test #10:
score: 0
Accepted
time: 19ms
memory: 88352kb
input:
884 7 1 7 2 6 7 1 7 2 5 5 1 7 5 4 5 2 5 4 2 2 4 3 2 7 1 6 3 3 2 1 1 2 1 7 7 4 3 5 1 1 6 6 7 5 1 6 6 4 3 5 2 3 1 6 3 7 2 7 4 6 6 6 3 7 6 1 3 2 1 1 5 4 3 1 4 4 4 7 2 5 7 5 7 5 3 6 5 5 1 4 5 6 6 6 3 6 7 3 2 3 1 5 5 6 7 6 5 3 2 7 3 1 2 5 5 1 2 7 5 3 1 3 6 4 7 2 4 4 5 6 7 4 7 4 2 4 1 2 1 2 6 7 1 7 4 1 1 ...
output:
298342150
result:
ok "298342150"
Test #11:
score: 0
Accepted
time: 24ms
memory: 99192kb
input:
2000 10 1 7 2 5 8 9 1 9 9 5 4 3 3 9 7 3 2 1 9 9 6 4 9 10 10 1 1 2 4 6 7 9 9 5 5 8 1 3 9 5 2 5 7 10 8 5 10 1 9 8 10 2 1 9 4 1 10 8 3 10 4 4 7 5 6 6 1 4 4 4 6 5 10 5 7 7 9 2 3 9 4 8 8 9 9 4 6 5 9 5 4 3 10 3 5 7 5 9 8 1 9 2 9 4 3 3 4 6 3 1 5 2 10 2 2 3 4 5 2 4 6 2 9 5 10 5 2 9 4 9 8 8 7 5 7 3 10 2 6 6 ...
output:
593281642
result:
ok "593281642"
Test #12:
score: 0
Accepted
time: 24ms
memory: 98204kb
input:
2000 10 1 4 3 9 2 9 3 9 2 7 1 4 10 1 10 8 10 1 6 9 5 7 5 10 10 1 10 5 7 1 5 5 8 10 10 4 10 6 6 1 9 8 5 2 3 5 3 1 1 3 3 6 2 6 9 8 4 10 8 7 8 9 10 5 3 6 3 2 4 10 1 10 8 7 10 7 1 4 3 2 8 8 7 7 9 1 7 5 3 5 7 6 6 9 8 8 8 9 7 10 8 3 5 5 1 3 10 9 1 9 2 10 9 3 1 6 1 7 10 9 9 9 3 6 9 2 10 6 1 5 2 2 5 6 6 9 1...
output:
635535966
result:
ok "635535966"
Test #13:
score: 0
Accepted
time: 23ms
memory: 98456kb
input:
2000 10 1 7 6 2 4 9 3 2 10 6 2 3 2 8 7 4 1 6 7 1 10 4 9 7 2 5 2 5 10 6 6 5 3 7 4 10 6 4 8 7 9 6 10 10 3 10 4 3 6 6 6 8 5 6 4 3 9 2 9 8 5 6 5 5 4 9 7 6 1 7 1 8 10 3 1 10 3 4 4 9 10 10 7 8 4 4 6 9 3 6 3 4 4 3 4 7 1 6 2 6 4 9 10 4 2 7 7 10 4 4 1 10 2 8 6 8 2 8 1 4 10 3 6 1 1 7 9 3 9 6 2 3 9 8 3 7 9 3 8...
output:
336713065
result:
ok "336713065"
Test #14:
score: 0
Accepted
time: 24ms
memory: 97964kb
input:
2000 10 1 10 10 2 4 8 7 8 9 8 7 5 10 8 2 5 5 1 3 10 5 4 3 6 3 9 9 10 9 9 9 6 10 6 2 9 3 7 4 7 10 2 4 7 3 9 3 7 10 5 9 10 7 8 1 7 7 9 10 6 4 10 4 3 6 10 5 4 7 5 6 8 8 1 6 5 7 7 5 4 2 5 8 5 9 9 9 7 10 2 9 7 6 1 8 9 2 4 1 9 8 7 9 4 2 3 2 3 2 7 5 4 8 8 2 4 8 6 4 1 3 3 9 7 10 7 7 3 8 1 1 4 2 3 4 10 8 8 8...
output:
85227947
result:
ok "85227947"
Test #15:
score: 0
Accepted
time: 23ms
memory: 96712kb
input:
2000 10 1 1 7 2 8 1 9 7 7 6 2 4 2 1 5 2 6 1 10 2 8 5 1 6 8 5 9 10 5 8 2 1 2 8 6 2 3 7 9 10 10 10 9 9 3 6 1 7 8 4 8 9 7 9 5 1 3 8 1 3 4 1 6 6 5 9 6 7 8 10 10 4 9 5 6 10 7 2 3 4 7 3 8 6 3 5 2 2 9 9 5 8 3 6 8 2 1 4 3 4 2 3 9 6 4 5 6 8 1 2 1 3 10 4 5 7 2 9 4 10 6 1 6 1 2 10 2 3 9 5 9 1 6 10 2 8 6 10 6 1...
output:
913697441
result:
ok "913697441"
Test #16:
score: 0
Accepted
time: 19ms
memory: 97392kb
input:
2000 10 1 7 9 2 6 9 1 10 1 8 3 4 5 1 10 6 10 4 10 3 1 10 2 10 8 3 5 2 2 4 9 5 7 2 4 8 5 7 5 1 10 8 10 5 8 10 4 2 9 8 9 6 3 7 10 1 7 6 9 4 10 8 5 1 3 5 7 3 6 3 2 8 5 6 2 8 2 7 6 1 6 7 4 3 5 8 3 8 9 5 6 2 8 2 4 5 2 4 1 3 9 7 1 5 9 9 2 3 2 1 8 6 1 3 6 7 3 5 5 8 3 9 5 9 1 7 2 3 5 1 7 8 10 3 4 10 8 3 6 8...
output:
298067446
result:
ok "298067446"
Test #17:
score: 0
Accepted
time: 28ms
memory: 97240kb
input:
2000 10 1 3 6 1 8 2 3 8 7 9 8 8 5 3 4 4 2 9 1 2 4 7 3 3 3 2 3 9 9 4 4 1 1 1 2 2 4 3 7 8 2 2 1 9 2 7 10 9 5 10 8 1 8 6 2 4 9 2 7 8 2 2 1 1 8 10 8 7 7 1 5 2 4 9 3 2 1 7 1 1 6 1 7 1 7 6 9 6 1 2 3 6 10 3 10 3 2 6 7 10 6 2 6 2 6 7 2 2 7 2 1 6 5 10 5 2 2 10 4 1 9 8 8 7 6 1 9 2 4 1 4 5 7 5 3 10 4 9 5 2 8 8...
output:
307824286
result:
ok "307824286"
Test #18:
score: 0
Accepted
time: 20ms
memory: 65292kb
input:
2000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
1
result:
ok "1"
Test #19:
score: 0
Accepted
time: 15ms
memory: 65620kb
input:
1 1 1 1 1 1
output:
1
result:
ok "1"
Test #20:
score: 0
Accepted
time: 31ms
memory: 96548kb
input:
2000 10 1 9 10 10 10 10 9 10 9 9 10 10 9 9 10 9 10 10 10 10 10 10 9 9 10 10 9 10 10 9 10 9 10 10 10 10 9 10 10 9 10 10 10 9 10 9 10 9 9 9 10 9 10 9 10 10 9 9 10 10 9 10 10 10 10 10 9 9 10 9 10 10 9 9 10 9 9 10 9 10 10 9 9 9 10 9 10 10 9 10 10 9 9 10 10 10 10 9 10 10 10 9 9 9 10 10 9 9 10 9 10 10 10 ...
output:
214050412
result:
ok "214050412"
Test #21:
score: 0
Accepted
time: 34ms
memory: 97504kb
input:
2000 10 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
output:
527357103
result:
ok "527357103"
Test #22:
score: 0
Accepted
time: 30ms
memory: 98444kb
input:
2000 10 1 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10...
output:
106236082
result:
ok "106236082"
Test #23:
score: 0
Accepted
time: 13ms
memory: 75840kb
input:
5484 3 1 1 3 1 3 3 1 1 2 3 1 3 3 3 3 3 2 2 3 1 3 3 2 1 3 3 1 2 2 2 3 2 2 3 2 3 2 1 2 1 1 1 1 2 2 3 1 1 3 3 1 3 1 1 2 2 2 3 1 3 1 3 2 1 3 1 3 2 1 3 1 1 1 3 1 3 1 2 2 1 2 2 1 3 3 3 2 3 1 2 1 1 3 1 1 1 2 2 1 3 2 3 2 3 1 3 2 2 2 3 1 3 2 2 2 3 2 3 1 2 3 1 1 1 3 3 3 2 3 3 3 3 2 2 1 3 1 1 1 2 1 2 2 1 1 2 3...
output:
886224409
result:
ok "886224409"
Test #24:
score: 0
Accepted
time: 83ms
memory: 141856kb
input:
8556 12 1 10 4 12 5 11 12 11 6 10 7 3 10 4 1 6 3 5 4 6 3 10 12 10 6 9 9 1 9 11 6 12 11 5 8 3 1 11 12 7 1 4 6 3 6 8 8 12 8 9 3 8 7 2 2 5 5 4 1 9 8 7 3 1 5 9 10 5 6 10 6 7 6 10 1 10 2 4 9 12 6 2 6 7 8 9 7 3 12 6 5 12 5 9 3 5 3 7 7 8 6 11 10 8 10 4 3 5 2 7 3 5 7 8 6 2 2 11 12 4 12 10 10 10 6 4 5 1 7 6 ...
output:
835287489
result:
ok "835287489"
Test #25:
score: 0
Accepted
time: 306ms
memory: 212056kb
input:
29076 14 1 14 12 7 10 5 11 7 12 1 14 2 7 12 1 14 13 9 10 13 1 14 2 10 11 5 4 8 13 8 1 5 9 5 10 1 4 9 13 10 9 12 6 7 2 14 13 11 3 6 6 4 6 11 1 2 12 6 1 12 1 3 8 6 6 3 11 4 10 2 10 11 2 5 11 13 14 12 11 2 9 4 12 3 4 2 2 14 2 10 8 11 4 5 11 2 7 11 1 9 13 2 2 12 10 5 4 5 4 4 9 9 2 7 13 12 2 14 6 12 3 4 ...
output:
428714926
result:
ok "428714926"
Test #26:
score: 0
Accepted
time: 101ms
memory: 144220kb
input:
21530 8 1 5 1 1 7 2 2 4 1 1 6 3 3 4 8 1 8 3 8 6 6 2 6 7 4 8 8 4 5 2 1 4 2 4 7 7 8 7 1 5 1 1 2 8 3 4 3 8 1 4 4 4 2 5 3 3 3 8 1 5 7 8 7 6 1 6 4 3 7 7 4 6 8 3 1 2 8 1 6 1 6 6 1 1 4 7 1 4 5 4 1 4 7 1 6 2 6 6 2 1 6 1 4 3 1 7 4 4 6 8 3 8 8 8 4 2 2 3 5 3 3 7 8 4 6 3 1 4 7 7 2 5 1 4 5 2 7 7 7 4 1 5 6 5 6 8 ...
output:
682167889
result:
ok "682167889"
Test #27:
score: 0
Accepted
time: 34ms
memory: 99568kb
input:
6134 7 1 6 7 4 4 2 2 5 2 2 3 3 1 5 4 5 6 7 6 7 2 1 1 5 3 1 6 2 2 6 2 5 2 1 2 4 7 5 2 6 1 5 5 1 6 1 3 3 3 5 5 3 7 3 6 2 3 5 3 3 4 6 2 3 4 3 1 3 3 7 1 5 6 2 7 3 7 4 7 7 4 2 2 3 6 1 1 7 1 3 4 5 3 6 4 2 7 4 6 2 1 5 7 1 5 3 5 7 1 7 3 2 1 5 7 6 4 1 7 6 1 7 7 3 1 1 3 1 4 5 5 7 4 5 4 2 1 2 2 3 1 2 4 2 6 1 6...
output:
479862425
result:
ok "479862425"
Test #28:
score: 0
Accepted
time: 36ms
memory: 105504kb
input:
5712 9 1 1 3 9 3 2 9 8 7 4 5 1 2 1 1 3 9 9 5 2 1 9 2 4 5 3 9 9 6 3 1 5 5 2 5 2 8 2 2 1 9 8 5 2 8 6 5 3 3 9 9 6 5 6 7 1 2 3 4 4 5 3 6 6 6 6 2 8 5 3 7 2 5 3 9 6 4 7 2 6 5 1 2 4 3 3 5 9 3 9 6 9 5 4 6 2 4 7 8 3 1 9 7 4 8 1 7 1 7 1 3 8 6 2 4 1 7 6 3 2 3 1 8 6 4 1 6 6 8 7 6 3 5 1 2 7 4 6 5 8 3 2 3 7 7 9 3...
output:
800069213
result:
ok "800069213"
Test #29:
score: 0
Accepted
time: 91ms
memory: 131264kb
input:
13882 10 1 3 7 7 2 9 8 8 8 2 10 4 9 8 2 2 10 6 7 9 9 9 2 1 7 8 3 1 6 3 5 5 4 10 6 7 1 9 4 7 5 6 10 5 3 3 5 1 4 8 5 9 10 4 4 9 3 6 7 2 9 7 4 4 4 7 9 2 2 1 8 6 8 7 6 6 6 6 2 8 4 10 8 4 9 5 10 6 4 5 1 8 9 7 3 10 3 4 2 10 4 5 9 4 5 4 2 4 2 9 7 6 3 2 3 5 4 5 1 9 4 9 8 4 5 9 8 8 7 8 9 2 5 3 8 10 8 8 7 7 1...
output:
840192715
result:
ok "840192715"
Test #30:
score: 0
Accepted
time: 369ms
memory: 220096kb
input:
30000 15 1 7 14 1 2 8 11 12 11 15 9 6 2 12 12 15 1 4 5 12 9 5 8 5 11 13 6 2 5 12 10 14 3 8 9 12 11 4 7 5 15 9 2 11 15 11 14 11 15 15 1 1 11 11 1 9 6 4 14 9 6 14 8 6 1 7 7 10 5 8 7 5 7 9 3 5 6 3 11 13 2 14 14 5 10 12 14 6 10 9 13 13 10 6 15 7 15 1 6 15 8 1 13 2 15 13 5 10 8 14 9 1 12 3 8 10 15 2 6 6 ...
output:
930560461
result:
ok "930560461"
Test #31:
score: 0
Accepted
time: 355ms
memory: 221384kb
input:
30000 15 1 11 5 10 8 7 7 3 11 9 13 14 7 12 7 2 8 14 6 6 5 12 13 4 2 2 12 14 10 8 14 12 10 6 11 6 15 3 5 15 15 11 15 9 6 4 3 13 4 1 14 7 10 6 15 6 8 15 15 10 3 7 9 7 6 14 14 11 5 11 5 11 13 12 7 6 12 3 1 15 2 10 8 7 15 10 1 2 13 9 1 9 6 3 4 4 5 2 1 4 7 6 14 2 5 3 2 4 8 4 6 12 14 9 2 15 15 13 4 5 5 12...
output:
486842491
result:
ok "486842491"
Test #32:
score: 0
Accepted
time: 368ms
memory: 219680kb
input:
30000 15 1 14 15 10 14 13 2 12 13 6 8 7 15 2 6 8 15 10 3 5 3 5 11 8 12 5 9 12 13 4 13 1 5 2 12 3 14 15 6 13 9 13 5 15 2 14 13 6 3 12 14 6 15 1 14 3 1 5 13 11 5 13 8 13 12 13 10 10 6 1 10 1 1 9 11 1 10 12 4 12 8 11 13 10 12 15 3 6 3 14 10 1 15 7 13 15 3 8 5 11 7 6 13 10 3 2 10 2 13 12 9 7 2 12 11 9 4...
output:
50307243
result:
ok "50307243"
Test #33:
score: 0
Accepted
time: 355ms
memory: 223448kb
input:
30000 15 1 1 14 14 11 14 13 4 13 12 10 8 3 3 10 11 6 9 8 4 5 4 10 9 6 4 6 9 5 14 4 10 12 2 4 15 2 8 3 12 7 4 13 14 6 9 9 4 11 7 14 4 13 8 7 11 9 14 15 5 1 3 15 5 15 1 8 4 4 15 6 1 4 6 14 1 7 5 11 5 4 3 7 7 11 3 8 11 3 6 8 11 8 3 1 9 11 7 6 14 6 8 11 1 7 15 8 14 9 15 5 11 3 11 12 6 2 4 2 13 12 14 3 7...
output:
630828146
result:
ok "630828146"
Test #34:
score: 0
Accepted
time: 349ms
memory: 222696kb
input:
30000 15 1 7 7 11 14 7 10 7 6 10 9 12 2 2 8 11 10 15 12 2 8 11 13 8 9 14 10 4 3 4 10 9 11 3 6 6 13 6 11 7 11 8 10 9 1 9 7 14 1 6 8 10 13 11 10 14 13 2 13 4 13 15 5 8 2 2 1 10 1 10 13 3 7 14 11 4 4 6 5 5 6 15 3 7 14 6 13 11 2 1 6 15 7 7 5 5 9 13 6 15 6 5 10 3 13 4 15 10 1 15 12 5 11 12 7 2 3 3 8 7 15...
output:
953149809
result:
ok "953149809"
Test #35:
score: 0
Accepted
time: 349ms
memory: 222332kb
input:
30000 15 1 14 13 9 7 2 8 9 2 6 1 10 6 3 4 8 15 12 6 15 9 12 9 11 5 4 4 12 2 10 7 12 5 14 10 4 9 7 7 8 3 2 7 5 1 1 9 1 9 11 13 12 9 8 14 12 14 3 13 5 1 1 9 12 9 13 12 2 1 12 1 1 7 7 10 2 13 11 3 10 15 15 12 1 13 9 2 3 3 1 12 5 5 11 15 15 5 12 12 4 13 5 5 4 2 2 3 9 10 6 5 8 4 1 1 14 6 4 14 8 8 3 15 12...
output:
54181826
result:
ok "54181826"
Test #36:
score: 0
Accepted
time: 346ms
memory: 221728kb
input:
30000 15 1 13 2 6 13 3 1 15 9 4 13 11 14 13 5 3 15 3 12 2 12 11 2 3 13 5 8 2 4 9 11 14 14 8 1 1 7 1 15 4 4 12 13 7 1 11 10 15 6 14 5 4 15 5 8 9 6 14 15 3 3 15 11 10 3 12 3 7 2 8 3 7 2 9 5 4 8 5 14 11 2 7 11 6 11 6 11 14 1 15 1 1 15 5 15 7 5 11 1 3 5 8 11 1 11 4 10 4 10 6 15 1 12 5 10 12 13 15 7 8 6 ...
output:
415874796
result:
ok "415874796"
Test #37:
score: 0
Accepted
time: 16ms
memory: 64560kb
input:
30000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1
result:
ok "1"
Test #38:
score: 0
Accepted
time: 809ms
memory: 222676kb
input:
30000 15 1 14 15 15 15 15 15 14 14 14 15 15 15 14 14 14 15 15 14 15 15 15 15 14 15 15 15 14 15 14 15 14 14 15 14 14 14 14 14 15 14 14 15 14 14 14 15 14 14 15 14 15 15 15 15 15 14 15 15 15 14 15 15 14 15 14 15 15 15 15 15 15 14 15 14 14 14 15 15 15 14 14 15 14 15 14 15 14 14 15 14 15 14 15 14 14 14 1...
output:
886986198
result:
ok "886986198"
Test #39:
score: 0
Accepted
time: 815ms
memory: 221320kb
input:
30000 15 1 15 15 15 14 14 15 15 14 14 14 14 15 14 15 14 15 15 14 14 14 14 15 14 15 14 14 14 14 15 15 15 14 14 14 15 15 15 15 15 15 15 15 14 14 15 14 15 15 14 14 14 14 15 15 14 15 14 15 15 15 14 15 15 15 14 15 14 15 14 15 14 14 14 15 15 14 14 15 14 15 14 14 14 14 14 14 15 14 15 15 15 14 15 15 14 15 1...
output:
668247064
result:
ok "668247064"
Test #40:
score: 0
Accepted
time: 819ms
memory: 219856kb
input:
30000 15 1 15 14 15 14 15 15 15 14 14 14 15 14 15 15 14 14 15 14 15 15 15 14 15 15 14 14 14 14 15 15 14 14 15 15 15 14 15 15 15 15 15 14 14 15 14 14 14 14 15 15 15 14 14 14 14 14 14 15 14 14 14 14 14 15 15 14 15 15 15 14 14 15 15 15 14 14 15 14 15 14 15 14 15 15 15 15 15 15 14 15 15 14 15 14 14 15 1...
output:
562849724
result:
ok "562849724"
Test #41:
score: 0
Accepted
time: 846ms
memory: 222196kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
673429076
result:
ok "673429076"
Test #42:
score: 0
Accepted
time: 848ms
memory: 220424kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
516022986
result:
ok "516022986"
Test #43:
score: 0
Accepted
time: 416ms
memory: 221724kb
input:
30000 15 1 1 15 1 15 1 1 1 15 1 1 15 15 15 1 1 15 15 15 1 1 1 1 15 1 15 15 1 1 15 1 1 1 1 1 1 15 1 15 15 1 15 15 15 1 1 15 1 1 1 15 15 15 1 1 1 1 1 15 15 1 1 1 15 1 1 15 15 15 15 1 1 15 1 1 1 1 15 15 15 15 15 1 15 15 1 1 15 1 1 15 15 1 15 15 15 1 15 1 1 15 15 15 15 1 15 1 1 15 1 15 1 15 1 1 1 15 1 1...
output:
115103138
result:
ok "115103138"
Test #44:
score: 0
Accepted
time: 410ms
memory: 220988kb
input:
30000 15 1 15 1 15 15 1 15 15 15 15 1 15 1 1 1 15 15 15 1 1 1 1 1 1 15 15 15 1 1 1 15 15 15 15 1 1 15 1 15 1 15 1 1 15 15 15 1 1 1 1 1 1 1 1 1 15 15 1 15 1 15 15 1 15 1 1 1 1 1 15 15 15 1 15 15 15 15 1 15 1 1 15 15 1 15 15 15 1 15 15 15 15 1 1 1 1 15 1 15 1 15 1 15 1 15 15 15 1 15 15 1 15 1 1 1 1 1 ...
output:
777366768
result:
ok "777366768"
Test #45:
score: 0
Accepted
time: 416ms
memory: 221964kb
input:
30000 15 1 1 1 15 1 1 15 1 15 1 1 15 15 1 1 1 1 15 1 1 1 15 15 15 15 1 15 1 1 15 1 1 1 15 15 15 1 15 15 1 1 15 1 15 15 1 1 15 15 15 1 1 1 1 15 1 1 1 15 15 15 1 15 15 15 1 1 15 1 15 1 1 1 1 15 1 15 15 1 1 1 1 1 15 1 1 15 15 1 15 1 1 15 15 1 15 15 1 1 1 1 1 1 15 15 15 1 1 15 1 15 15 15 1 1 15 15 1 15 ...
output:
879322138
result:
ok "879322138"
Test #46:
score: 0
Accepted
time: 838ms
memory: 222708kb
input:
30000 15 1 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 1...
output:
354391629
result:
ok "354391629"
Test #47:
score: 0
Accepted
time: 394ms
memory: 221448kb
input:
30000 15 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
666493861
result:
ok "666493861"
Test #48:
score: 0
Accepted
time: 350ms
memory: 221872kb
input:
30000 15 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1...
output:
640857910
result:
ok "640857910"
Test #49:
score: 0
Accepted
time: 361ms
memory: 221892kb
input:
30000 15 1 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1...
output:
370646039
result:
ok "370646039"
Test #50:
score: 0
Accepted
time: 373ms
memory: 220564kb
input:
30000 15 1 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...
output:
553300345
result:
ok "553300345"
Test #51:
score: 0
Accepted
time: 265ms
memory: 167480kb
input:
23069 10 12025 4 2 8 7 5 4 10 6 5 10 1 10 1 4 4 10 5 7 7 3 5 5 7 4 7 2 6 8 9 2 7 8 2 7 3 7 9 5 10 2 5 10 9 10 8 10 9 3 4 1 4 6 5 5 10 7 1 7 2 8 2 3 8 8 10 9 9 4 1 3 7 5 1 1 4 7 3 6 9 8 7 6 1 7 8 1 7 9 9 8 3 4 8 6 4 8 8 8 7 1 1 5 5 10 9 1 8 8 5 10 9 2 3 10 9 2 7 8 10 5 10 10 8 6 7 8 6 8 9 5 6 1 10 10...
output:
968505026 55485091 361959346 283015680 679237632 483478779 307144355 11544202 502008227 137763897 982935997 27264320 127349300 99734190 670547928 841455638 841455638 301643587 83331998 691289897 731349157 61957510 947528086 947528086 675446634 225148878 288646400 742863125 381490210 381490210 469827...
result:
ok 12025 tokens
Test #52:
score: 0
Accepted
time: 290ms
memory: 145320kb
input:
23602 8 25014 1 8 2 8 2 6 5 4 5 7 1 7 5 1 1 7 5 1 7 5 1 2 2 3 7 2 6 7 7 3 3 5 4 2 5 2 1 5 6 2 6 8 3 8 7 3 2 1 1 7 1 6 2 1 2 2 4 1 4 2 8 6 1 4 5 4 6 3 7 4 7 5 8 2 6 4 5 3 2 3 2 6 2 1 1 2 6 7 3 5 3 1 6 5 1 4 8 8 4 2 4 4 2 6 5 2 4 2 7 1 5 1 5 5 5 3 4 6 5 7 4 8 1 8 2 1 8 2 1 2 1 1 6 8 2 7 1 5 3 1 1 2 2 ...
output:
541177119 162234248 440904283 440904283 579266741 971024033 656440670 656440670 925808612 104007635 778759007 559638022 39631014 252123373 106588833 786024463 450259677 62557367 636807778 642532807 989365725 69307623 348298986 464398648 464398648 766281407 791933041 922191335 51856525 51856525 51856...
result:
ok 25014 tokens
Test #53:
score: 0
Accepted
time: 268ms
memory: 134888kb
input:
25107 7 28960 1 5 1 1 6 1 1 6 2 6 5 5 7 1 7 5 4 2 3 2 5 2 1 4 4 1 2 1 3 7 7 4 7 6 6 7 2 4 5 3 3 5 1 3 6 5 2 4 3 2 5 3 5 5 7 2 6 2 6 2 5 3 6 6 7 2 7 5 6 2 6 4 6 4 2 6 4 4 5 1 3 5 5 3 5 3 2 4 1 4 4 1 5 3 7 1 6 3 4 1 5 3 2 7 2 4 2 4 6 4 4 2 2 5 1 4 7 7 2 4 3 5 1 5 5 6 7 6 6 6 4 3 1 2 7 2 3 5 7 1 4 6 6 ...
output:
199053210 516843380 93977920 994981348 442686656 623060698 732931746 589908424 84272632 951269247 416915741 492718603 859538916 104801350 104801350 864382357 205550713 106464008 99814418 199959150 341431732 341431732 934166748 281772142 976679351 447471840 34027970 897467716 119027561 756889039 7680...
result:
ok 28960 tokens
Test #54:
score: 0
Accepted
time: 196ms
memory: 150564kb
input:
13962 13 3707 4 6 12 5 13 11 7 10 1 7 10 2 3 10 3 13 8 5 12 13 4 9 1 13 8 4 7 1 6 12 13 1 13 10 10 6 9 2 9 9 4 3 10 12 3 4 9 10 6 4 7 9 7 10 3 1 3 1 11 13 7 11 2 13 2 10 5 5 11 1 11 13 9 6 8 8 4 4 1 11 7 7 13 1 9 8 7 13 7 6 6 9 4 7 10 12 9 2 10 8 3 12 5 5 12 8 5 2 5 11 10 7 6 2 4 9 3 3 9 8 4 11 3 7 ...
output:
276109416 840238204 694858458 664652304 286153540 666015604 443262601 575437164 359340320 157504118 352213706 58396765 546877234 614428039 609590093 795973112 178492641 825384521 941188876 714749531 548944676 548944676 364923716 729847432 591148054 978781901 736900663 736900663 692684825 647423253 9...
result:
ok 3707 tokens
Test #55:
score: 0
Accepted
time: 378ms
memory: 202828kb
input:
18584 13 14364 10 11 4 10 8 10 10 8 9 3 11 9 9 7 4 8 4 12 10 8 10 12 2 13 2 4 7 12 10 3 10 4 6 5 9 8 11 4 2 6 8 7 1 4 13 8 11 11 4 2 2 12 2 4 8 1 13 6 4 7 10 11 3 7 10 12 9 1 3 10 12 5 10 7 11 3 10 13 2 10 4 6 11 8 7 8 2 5 10 7 7 1 1 5 12 10 7 5 3 2 8 4 12 2 4 11 12 5 9 2 4 5 3 11 13 7 1 9 5 13 1 1 ...
output:
658709022 497231145 871575369 258501464 499540539 482627339 341365782 144778896 808883262 565147088 113575925 728645018 388249791 312547060 94372671 50816229 816496597 891308538 261249127 639631151 291100596 941452278 323552752 278537075 90711667 930283262 258822286 674851472 792959367 968689642 704...
result:
ok 14364 tokens
Test #56:
score: 0
Accepted
time: 372ms
memory: 189168kb
input:
28547 12 10076 5 3 11 6 10 3 1 6 12 12 2 10 4 1 1 1 11 5 11 7 7 12 4 10 5 7 6 6 10 2 7 6 8 7 7 9 10 10 8 9 11 5 4 12 9 9 11 8 11 7 10 11 4 8 8 7 10 11 9 4 4 9 9 4 3 12 11 10 6 8 9 3 4 10 2 3 9 4 9 11 10 1 9 10 4 12 8 12 6 4 4 1 1 3 7 6 11 2 12 4 12 4 1 5 2 6 10 4 5 2 7 3 7 10 10 4 9 2 8 10 9 6 7 3 5...
output:
885664536 885664536 23889076 456414884 456414884 539163546 952326779 952326779 193910068 715078137 893170269 377884337 361564758 212928322 959212520 746410474 704821236 759627885 3694311 740124339 46628499 338179891 242514922 255559380 64018819 308244426 877375429 756506505 956562987 956562987 89896...
result:
ok 10076 tokens
Test #57:
score: 0
Accepted
time: 24ms
memory: 75056kb
input:
1407 3 8746 2 3 1 2 3 1 1 3 2 2 3 3 1 2 3 2 2 3 3 1 2 3 3 3 2 3 1 1 1 1 3 2 1 1 1 3 1 2 3 1 2 3 1 2 2 2 1 2 2 2 2 1 2 3 1 3 2 1 1 2 2 1 3 2 2 2 2 2 1 2 3 1 3 1 3 2 3 2 2 3 3 3 1 3 1 3 2 1 1 2 2 2 2 2 2 2 2 1 2 3 2 2 3 3 1 2 2 3 1 3 3 1 1 3 3 1 2 2 1 3 3 1 2 3 3 1 3 3 3 1 1 1 3 3 1 3 2 2 3 3 2 2 2 1 ...
output:
523300148 523300148 48355943 523300148 48355943 523300148 784950222 784950222 784950222 784950222 71672392 71672392 71672392 71672392 71672392 390161532 390161532 390161532 390161532 390161532 24605749 24605749 24605749 24605749 511425051 340950034 340950034 392559473 404218891 701231622 382777659 3...
result:
ok 8746 tokens
Test #58:
score: 0
Accepted
time: 977ms
memory: 220656kb
input:
30000 15 30000 12 7 10 15 5 2 11 4 7 12 2 12 6 6 1 5 11 7 1 4 14 12 15 6 1 15 7 1 4 5 9 5 11 6 4 12 1 11 14 8 8 6 15 10 11 11 11 4 4 2 11 10 3 5 10 1 1 6 5 11 11 8 12 2 5 4 7 4 2 5 3 6 5 1 13 4 2 11 10 7 3 15 6 15 13 4 10 2 11 4 4 11 12 5 4 2 9 15 4 9 12 5 9 1 10 7 15 14 14 11 14 7 10 7 7 10 10 3 3 ...
output:
422825564 173618451 369359593 320019089 822965970 520883044 806325492 369272646 490312261 276458720 297112238 902887719 359707127 648508474 460078842 111250807 233596313 332001014 694787936 388363595 505553734 125839435 353657423 74619701 520944322 978282345 871352168 159818860 620006959 333023627 5...
result:
ok 30000 tokens
Test #59:
score: 0
Accepted
time: 992ms
memory: 220816kb
input:
30000 15 30000 6 2 2 11 3 3 2 5 4 1 9 11 2 10 1 10 9 9 10 2 8 10 14 8 10 13 6 8 8 3 4 4 14 4 14 2 12 12 7 8 3 2 9 2 14 11 9 4 9 1 10 8 3 2 4 7 14 11 6 15 14 12 6 1 10 13 4 10 11 2 8 4 7 10 2 5 15 8 8 9 7 11 15 14 12 1 7 13 5 14 6 7 8 11 14 13 13 4 5 5 7 7 15 11 14 14 9 4 2 13 6 6 15 15 15 8 12 10 13...
output:
911850639 306319924 704128449 774810437 723572106 745848746 996839028 540861711 690484474 567044611 532989909 837374986 604256643 228528261 479173379 91352124 76735246 510362953 812042680 822703379 96627561 31861849 705093455 806658813 38850320 823895999 763777444 63070413 444277867 143317154 829787...
result:
ok 30000 tokens
Test #60:
score: 0
Accepted
time: 974ms
memory: 220864kb
input:
30000 15 30000 1 3 3 2 1 6 11 6 4 5 8 8 2 8 14 9 10 3 8 2 10 13 2 4 13 14 3 11 14 4 4 10 1 13 8 12 2 10 13 10 5 13 10 7 1 12 10 1 14 12 13 14 14 6 11 13 4 8 9 2 9 2 7 12 13 1 3 9 12 12 14 1 3 13 14 4 9 1 13 3 7 8 6 4 6 5 5 11 6 13 9 12 14 7 5 14 11 10 7 3 2 12 4 15 13 8 3 7 4 7 9 6 1 14 4 13 10 11 1...
output:
695654402 44021274 254792959 693770195 566765790 324209157 119611695 617317219 301196910 804178987 382874052 942441736 413566869 409687723 414634185 669694655 543808857 256146538 67809146 834834286 653593698 860384091 992193686 414986262 14111135 354882059 802547633 318815276 592492221 810356830 498...
result:
ok 30000 tokens
Test #61:
score: 0
Accepted
time: 978ms
memory: 221708kb
input:
30000 15 30000 2 7 15 12 15 10 7 15 9 12 5 15 15 6 7 5 6 13 9 7 4 2 15 6 14 3 8 3 6 12 2 6 7 1 2 15 11 13 12 14 7 13 8 1 9 14 11 5 3 8 14 3 5 3 4 12 1 12 11 3 2 3 2 10 1 13 1 7 13 15 7 3 9 10 6 5 1 2 7 11 4 15 12 4 13 14 14 7 12 5 9 3 10 13 1 10 7 6 3 1 2 7 1 1 2 9 13 15 13 13 10 13 8 6 11 5 14 11 1...
output:
144411293 269002213 124284731 376229243 210868296 130318287 767330290 100032485 686506705 436229375 366854883 535501260 655239997 723808410 311160595 716934593 813285259 608332841 336926304 673852608 7184886 267547351 300856584 656010697 867332696 84392952 552200686 624771665 570597968 841674781 309...
result:
ok 30000 tokens
Test #62:
score: 0
Accepted
time: 985ms
memory: 222656kb
input:
30000 15 30000 10 2 5 11 7 14 13 2 14 12 15 11 14 5 10 8 11 7 4 9 8 15 2 9 7 15 3 2 3 13 14 5 6 5 10 13 6 4 9 14 6 1 13 1 13 10 9 1 1 13 8 4 1 9 12 14 11 6 14 8 6 7 12 13 8 13 14 14 12 11 9 5 8 14 3 14 3 12 13 1 12 14 7 1 12 1 14 15 13 5 13 9 3 9 12 13 11 11 10 15 5 15 10 12 5 10 10 15 4 5 2 15 5 1 ...
output:
277733635 237579028 180832486 704228788 605345120 891501570 230297208 717621293 16772585 519449810 349956873 317148184 882401416 391888896 613464099 573145292 210929203 699445337 206163165 514952921 164680380 717412599 167755887 664483528 617617081 294884241 646564297 772905926 696720290 529046725 8...
result:
ok 30000 tokens
Test #63:
score: 0
Accepted
time: 984ms
memory: 222936kb
input:
30000 15 30000 4 11 7 4 4 12 11 4 12 14 14 8 14 4 14 3 8 4 3 3 12 11 5 4 13 1 6 13 15 15 14 5 12 11 1 15 11 6 10 2 2 11 10 10 7 10 11 2 11 6 4 8 9 6 7 7 15 9 13 15 15 13 14 15 13 11 5 13 1 4 12 8 1 2 2 5 13 8 15 4 3 6 9 14 13 3 12 9 15 6 2 13 9 4 8 15 10 13 7 6 3 8 6 15 9 10 11 2 11 11 14 8 10 6 13 ...
output:
176911054 192496265 229759211 677501694 730256044 125595902 97624243 125426053 505701065 670834234 143071404 67409584 197160379 754101840 532983156 190029336 183929637 157999763 684942416 752527933 77521510 677163517 293235383 635573878 970359073 379556449 258040697 352726849 992955172 92948500 2684...
result:
ok 30000 tokens
Test #64:
score: 0
Accepted
time: 977ms
memory: 219696kb
input:
30000 15 30000 9 8 10 11 12 14 8 13 4 3 8 15 12 14 1 9 11 8 7 2 5 13 10 13 12 9 9 14 14 9 15 1 9 15 4 12 5 12 12 15 12 3 10 7 10 5 3 1 9 6 10 15 9 10 3 15 1 11 1 11 8 9 3 6 4 10 10 1 3 13 6 7 11 8 8 8 9 10 2 14 13 1 8 3 4 3 8 3 1 5 6 1 8 6 12 10 12 3 1 14 2 9 3 11 15 6 8 5 6 2 14 11 9 1 8 8 3 1 2 6 ...
output:
288608384 479424503 19861618 965843147 666999743 826900204 200513189 55241793 266573584 522764094 608828540 888444240 684634228 308258526 799673534 784028889 603264038 994290278 795285562 234659887 512038296 595129357 414604643 972952179 44656275 287014373 518293475 657934701 778817341 766374702 731...
result:
ok 30000 tokens
Test #65:
score: 0
Accepted
time: 831ms
memory: 222336kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #66:
score: 0
Accepted
time: 847ms
memory: 222012kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #67:
score: 0
Accepted
time: 844ms
memory: 221280kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 516022986 ...
result:
ok 30000 tokens
Test #68:
score: 0
Accepted
time: 1627ms
memory: 220580kb
input:
30000 15 30000 15 15 15 14 14 14 15 15 14 15 15 15 14 15 15 15 14 15 15 15 14 15 14 15 14 14 14 14 14 14 15 15 14 14 15 14 14 15 14 15 14 14 14 15 14 14 14 15 14 15 14 14 14 15 15 15 14 15 14 15 14 14 14 15 14 14 14 14 15 15 15 15 14 15 14 14 14 15 14 15 14 14 14 15 14 15 14 15 15 14 15 15 14 15 14 ...
output:
271303973 393197562 242411169 564512217 413395002 830609754 19828254 648605494 468904844 761697230 409067600 761697230 892942863 281479889 735134544 300358846 130831501 467669709 718657262 467669709 288885758 353802173 514478210 988186286 200140084 801984458 202058806 801984458 103702931 206100357 8...
result:
ok 30000 tokens
Test #69:
score: 0
Accepted
time: 1626ms
memory: 221976kb
input:
30000 15 30000 15 15 14 15 15 15 14 15 14 15 14 15 15 15 14 15 15 14 15 14 14 14 14 14 15 14 14 14 15 15 15 15 14 15 14 14 15 15 14 14 15 14 15 14 15 14 15 15 14 14 14 15 15 14 14 14 14 14 15 15 15 14 14 15 14 14 15 14 14 15 14 14 15 15 15 14 15 15 14 14 14 14 15 15 15 14 15 14 15 15 15 15 15 14 14 ...
output:
144286857 139929931 482364038 778779991 373367544 640112819 767474108 166148260 439230524 454881360 64049068 555245277 481485550 555245277 158950371 567652772 158950371 289891502 810282968 483253164 974654751 658763223 757484856 569464391 278295284 809395835 577462905 737197266 628910641 393789076 1...
result:
ok 30000 tokens
Test #70:
score: 0
Accepted
time: 1631ms
memory: 221540kb
input:
30000 15 30000 14 15 14 15 14 14 15 15 14 14 15 14 15 15 15 14 14 14 15 15 15 15 14 14 14 15 14 15 15 14 14 15 14 14 15 15 14 15 14 15 15 14 14 14 15 15 15 15 14 15 14 14 14 14 15 15 15 14 14 14 15 15 14 14 14 14 15 15 15 15 14 14 14 14 14 14 14 14 15 14 14 14 14 15 15 15 15 15 15 15 14 15 15 15 15 ...
output:
934044862 786017894 123126924 132826079 123126924 389860364 4703120 389860364 45519774 901100612 330646678 703911303 481508126 106354267 764554326 587180464 793987507 273450870 589200097 407757573 437947314 650915897 219753770 460144593 141417431 574726287 516090915 250056301 152233410 388242277 731...
result:
ok 30000 tokens
Test #71:
score: 0
Accepted
time: 1504ms
memory: 223236kb
input:
30000 15 30000 15 1 15 1 1 15 15 15 15 15 1 15 15 15 1 15 15 15 1 1 15 1 1 1 1 15 1 15 15 15 1 1 1 15 15 15 15 15 15 15 1 15 1 1 15 15 1 1 1 15 1 1 1 1 15 1 1 15 1 15 15 15 1 1 1 1 15 15 15 1 1 15 15 1 15 15 15 1 15 15 15 15 15 1 1 1 15 1 1 15 15 15 15 15 15 1 1 1 1 1 1 1 1 1 1 1 15 15 15 15 15 1 15...
output:
327899433 273530187 109975393 131223449 109975393 548940291 248149541 644812394 248149541 727510056 930207310 370920892 91277683 272283673 91277683 370920892 572591615 137191735 674642351 577373145 667351777 488161966 123859088 859641967 915697269 859641967 915697269 760513994 915697269 813823203 43...
result:
ok 30000 tokens
Test #72:
score: 0
Accepted
time: 1512ms
memory: 219900kb
input:
30000 15 30000 1 1 1 15 1 1 1 15 1 15 1 1 15 1 1 1 15 1 15 1 1 15 1 1 1 15 1 1 15 1 1 15 15 15 1 1 1 1 15 15 1 15 15 15 1 15 1 1 1 1 15 15 15 1 15 15 15 1 15 15 1 15 15 15 1 1 15 15 1 15 15 15 15 1 15 15 15 1 15 1 1 15 15 15 1 15 1 1 1 1 1 15 15 1 15 15 1 15 1 1 1 15 15 1 1 1 1 15 15 1 1 15 1 15 1 1...
output:
957107477 381191213 134732105 24492869 367393035 24492869 692199425 589689690 692199425 816738972 145619034 687023420 322907770 403792323 67418727 366686312 585320063 793846121 212653884 195075201 212653884 842925198 664945734 989986833 874381553 967413046 113235969 319501450 583156039 441860480 103...
result:
ok 30000 tokens
Test #73:
score: 0
Accepted
time: 1490ms
memory: 220204kb
input:
30000 15 30000 1 15 1 1 1 1 1 15 1 1 15 15 15 15 1 1 15 1 1 1 15 15 15 15 1 15 15 15 1 1 15 15 15 1 1 15 1 15 1 15 15 1 15 15 15 15 1 1 1 15 15 15 1 1 15 15 1 1 15 1 15 1 1 15 1 1 15 1 1 15 1 1 15 1 15 1 15 15 1 15 15 1 15 15 1 15 15 1 15 1 1 1 15 15 15 15 15 1 15 15 15 15 15 1 15 1 15 1 1 15 1 15 1...
output:
885998411 312799576 689490755 378714168 624194223 378714168 885998411 591463549 378906488 855869619 859112049 624700039 957051983 380358803 906974272 127014575 485392124 165458722 485392124 293171389 195129029 930446729 195129029 930446729 979524346 930446729 445450889 12516368 241242971 12516368 44...
result:
ok 30000 tokens
Test #74:
score: 0
Accepted
time: 1799ms
memory: 222492kb
input:
30000 15 30000 14 14 15 14 14 14 14 14 14 15 15 14 14 14 15 14 14 14 15 14 15 15 14 14 15 15 15 15 15 15 15 14 15 15 14 14 14 14 14 14 15 14 15 15 15 14 14 14 14 14 14 15 14 14 14 15 14 14 14 15 15 15 14 14 15 14 15 14 14 14 15 14 14 14 14 15 14 14 14 15 14 15 15 15 15 14 14 14 14 14 15 15 15 15 14 ...
output:
559144059 176936220 761538112 813251100 876179632 226602662 10077336 37101663 764478744 764478744 808524556 17222647 433042077 433042077 154037043 154037043 958908974 958908974 550285500 582629587 783558978 348842093 444809574 879511458 347755031 347755031 938745588 938745588 636055074 636055074 974...
result:
ok 30000 tokens
Test #75:
score: 0
Accepted
time: 1797ms
memory: 219696kb
input:
30000 15 30000 14 15 15 14 14 15 14 15 14 14 14 14 14 15 14 15 15 14 14 14 15 15 15 15 15 14 14 14 15 14 15 14 15 14 15 14 15 15 14 14 14 15 15 15 14 14 14 15 15 15 15 14 14 15 15 15 14 15 14 15 15 14 14 14 15 14 15 15 14 15 14 15 15 15 14 14 14 15 15 14 14 14 14 15 14 15 14 14 15 14 15 15 14 14 15 ...
output:
891448418 866843958 176519646 176519646 116756294 116756294 594445301 361980982 540094246 540094246 125976558 162978189 395234138 395234138 734739729 734739729 12865452 12865452 689667580 689667580 180876541 784234043 300268952 810166468 993459747 993459747 970699461 762374651 849852584 849852584 18...
result:
ok 30000 tokens
Test #76:
score: 0
Accepted
time: 1802ms
memory: 219876kb
input:
30000 15 30000 14 14 14 14 14 15 14 14 15 15 15 14 14 14 14 15 14 14 15 15 15 15 15 15 15 15 14 14 14 14 15 14 14 15 14 14 15 15 14 15 15 14 15 14 14 14 15 14 15 14 14 14 15 15 14 15 15 15 14 14 14 14 14 14 14 15 14 15 14 14 14 14 14 14 14 15 14 14 15 14 15 15 14 14 14 14 15 15 15 15 15 15 15 14 15 ...
output:
692028145 692028145 62484031 62484031 867622764 867622764 724766884 724766884 88791421 88791421 573896963 146947883 60463571 193535368 537511842 394110625 715438485 895531038 125966928 298144165 427567018 812712667 434027841 434027841 875969697 875969697 262350710 262350710 542268879 542268879 78945...
result:
ok 30000 tokens
Test #77:
score: 0
Accepted
time: 1935ms
memory: 219656kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 141948272 516022986 ...
result:
ok 30000 tokens
Test #78:
score: 0
Accepted
time: 1919ms
memory: 219752kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022986 41762758 516022...
result:
ok 30000 tokens
Test #79:
score: 0
Accepted
time: 1922ms
memory: 221612kb
input:
30000 15 30000 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 15 ...
output:
237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 237763401 516022986 ...
result:
ok 30000 tokens
Test #80:
score: 0
Accepted
time: 20ms
memory: 64908kb
input:
30000 1 30000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
output:
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
result:
ok 30000 tokens
Extra Test:
score: 0
Extra Test Passed