UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#184136#3299. 队伍分配Richard12111004938ms66072kbC++117.6kb2023-08-10 12:06:582023-08-10 12:43:14

answer

//#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
//#include <bits/extc++.h>
#else
//#include <ext/rope>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/hash_policy.hpp>
//#include <ext/pb_ds/trie_policy.hpp>
//#include <ext/pb_ds/priority_queue.hpp>
#endif
using namespace std;
//using namespace __gnu_cxx;
//using namespace __gnu_pbds;
const double pi=3.141592653589793238462643383279;
template<class T>inline T Min(register T a,register T b){
    return a<b?a:b;
}
template<class T>inline T Max(register T a,register T b){
    return a>b?a:b;
}
template<class T>inline bool Cmin(register T &a,register T b){
	return a>b?(a=b,true):false;
}
template<class T>inline bool Cmax(register T &a,register T b){
	return a<b?(a=b,true):false;
}
template<class T>inline T Abs(register T a){
    return a>0?a:-a;
}
template<class T>inline T Lowbit(register T x){
    return (x)&(-x);
}
template<class T>inline void Swap(register T &a,register T &b){
    b^=a^=b^=a;
}
template<class T>inline T Gcd(T a,T b){
    return b?Gcd(b,a%b):a;
}
template<class T>inline T Lcm(T a,T b){
    return a*b/Gcd(a,b);
}
template<class T>inline T Exgcd(T a,T b,T &x,T &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    T d=Exgcd(b,a%b,x,y);
    T t=x;
    x=y;
    y=t-a/b*y;
    return d;
}
template<class T>inline T ExExgcd(T a,T b,T &x,T &y,T c){
    if(b==0){
        x=c;
        y=0;
        return a;
    }
    T d=ExExgcd(b,a%b,x,y,c);
    T t=x;
    x=y;
    y=t-a/b*y;
    return d;
}
template<class T>inline T Ksc(T a,T b){
	if(a==0||b==0){
		return 0;
	}
	T ans=0;
	while(b){
		if(b&1){
			ans=a+ans;
		}
		a=a+a;
		b>>=1;
	}
	return ans;
}
template<class T>inline T Ksc(T a,T b,T p){
	if(a==0||b==0){
		return 0;
	}
	T ans=0;
	while(b){
		if(b&1){
			ans=(a+ans)%p;
		}
		a=(a+a)%p;
		b>>=1;
	}
	return ans;
}
template<class T>inline T Ksm(T a,T b,bool f=false){
	if(a==0){
		return 0;
	}
	if(b==0){
		return 1;
	}
    T ans=1;
    while(b){
        if(b&1){
            ans=!f?a*ans:Ksc(a,ans);
        }
        a=!f?a*a:Ksc(a,a);
        b>>=1;
    }
    return ans;
}
template<class T>inline T Ksm(T a,T b,T p,bool f=false){
	if(a==0){
		return 0;
	}
	if(b==0){
		return 1%p;
	}
    T ans=1;
    while(b){
        if(b&1){
            ans=!f?a*ans%p:Ksc(a,ans,p);
        }
        a=!f?a*a%p:Ksc(a,a,p);
        b>>=1;
    }
    return ans;
}
template<class T>inline T Inv(T x,T p){
	return Ksm(x,p-2,p);
}
template<class T>inline T Fac(T n){
    if(n==0){
        return 1;
    }
    long long ans=1;
    for(long long i=1;i<=n;i++){
        ans*=i;
    }
    return ans;
}
template<class T>inline T Fac(T n,T p){
    if(n==0){
        return 1;
    }
    long long ans=1;
    for(long long i=1;i<=n;i++){
        ans=ans*i%p;
    }
    return ans;
}
template<class T>inline long long Onenum(T x,bool f=true){
	return f?__builtin_popcountll(x):__builtin_popcount(x);
}
template<class T>inline long long Lowone(T x,bool f=true){
	return f?__builtin_ffsll(x):__builtin_ffs(x);
}
template<class T>inline long long Oneoddeven(T x,bool f=true){
	return f?__builtin_parityll(x):__builtin_parity(x);
}
template<class T>inline long long Prezero(T x,bool f=true){
	return f?__builtin_clzll(x):__builtin_clz(x);
}
template<class T>inline long long Sufzero(T x,bool f=true){
	return f?__builtin_ctzll(x):__builtin_ctz(x);
}
template<class T>inline bool Isdigit(T ch){
    return ch>='0' && ch<='9';
}
template<class T>inline bool Isletter(T ch){
    return ch>='A' && ch<='Z' || ch>='a' && ch<='z';
}
template<class T>inline void Memset(T *d,long long n,long long s){
    for(long long i=0;i<=s-1;i++){
        d[i]=n;
    }
}
template<class T>inline void debug(T s,string name){
    cout << name << ": " << s << endl;
}
template<class T>inline void bug(T s){
    cout << s << endl;
}
template<class T>inline T Sin(register T degree){
    return sin(degree*(pi/180));
}
template<class T>inline T Cos(register T degree){
    return cos(degree*(pi/180));
}
template<class T>inline T Tan(register T degree){
    return tan(degree*(pi/180));
}
template<class T>inline T Asin(register T degree){
    return asin(degree*(pi/180));
}
template<class T>inline T Acos(register T degree){
    return acos(degree*(pi/180));
}
template<class T>inline T Atan(register T degree){
    return atan(degree*(pi/180));
}
inline int rd(){
    int x=0,f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-'){
            f=-1;
        }
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=(x<<1)+(x<<3)+(ch-'0');
        ch=getchar();
    }
    return x*f;
}
inline long long read(){
    long long x=0,f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-'){
            f=-1;
        }
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=(x<<1)+(x<<3)+(ch-'0');
        ch=getchar();
    }
    return x*f;
}
inline unsigned long long Read(){
    unsigned long long x=0;
	long long f=1;
    char ch=getchar();
    while(ch<'0' || ch>'9'){
        if(ch=='-'){
            f=-1;
        }
        ch=getchar();
    }
    while(ch>='0' && ch<='9'){
        x=(x<<1)+(x<<3)+(ch-'0');
        ch=getchar();
    }
    return x*f;
}
inline bool wrt(int x,char ch='\n'){
	static char buf[64];
    static int len=-1;
    if(x<0){
        putchar('-');
        x=-x;
    }
    do{
        buf[++len]=x%10;
        x/=10;
    }
    while(x);
    while(len>=0){
        putchar(buf[len--]+'0');
    }
    putchar(ch);
    return true;
}
inline bool write(long long x,char ch='\n'){
    static char buf[64];
    static long long len=-1;
    if(x<0){
        putchar('-');
        x=-x;
    }
    do{
        buf[++len]=x%10;
        x/=10;
    }
    while(x);
    while(len>=0){
        putchar(buf[len--]+'0');
    }
    putchar(ch);
    return true;
}
inline bool Write(unsigned long long x,char ch='\n'){
	static char buf[64];
    static long long len=-1;
    if(x<0){
        putchar('-');
        x=-x;
    }
    do{
        buf[++len]=x%10;
        x/=10;
    }
    while(x);
    while(len>=0){
        putchar(buf[len--]+'0');
    }
    putchar(ch);
    return true;
}
inline void OF(string s){
    string IN=s+".in";
    string OUT=s+".out";
    freopen(IN.c_str(),"r",stdin);
    freopen(OUT.c_str(),"w",stdout);
}
inline void CF(string s){
    fclose(stdin);
    fclose(stdout);
}
const long long N=2020;
const long long MOD=998244353;
long long n;
long long buc[N],C[N][N],S[N][N],dp[N][N];
//¼¯ºÏ´óСΪ i,»¹ÓÐj¸öÖµ´óÓÚµÈÓÚiµÄÈËûÓб»°²Åŵ½¶ÓÁÐÀïÃæ 
inline void init(){
	C[0][0]=1;
	for(register int i=1;i<=n;++i){
		C[i][0]=1;
		for(register int j=1;j<=n;++j){
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
		}
	}
	for(register int i=0;i<=2000;++i){
		S[i][0]=S[0][i]=1;
	}
	for(register int i=1;i<=n;++i){
		for(register int j=1;i*j<=n;++j){
			S[i][j]=S[i][j-1]*C[i*j-1][i-1]%MOD;
		}
	}
}
int main(){
	n=read();
	init();
	for(register int i=1;i<=n;++i){
		++buc[read()];
	}
	for(register int i=2000;i>=1;--i){
		buc[i]+=buc[i+1];
	}
	dp[2001][0]=1;
	for(register int i=2000;i>=1;--i){
		for(register int j=0;j<=buc[i];++j){
			for(register int k=j,x=0;k>=0;k-=i,++x){
				if(dp[i+1][k]){
					dp[i][j]=(dp[i][j]+dp[i+1][k]*C[buc[i]-k][j-k]%MOD*S[i][x])%MOD;
				}
			}
		}
	}
	return !write(dp[1][n]);
}

详细

小提示:点击横条可展开更详细的信息

Subtask #1:

score: 23
Accepted

Test #1:

score: 23
Accepted
time: 2ms
memory: 19244kb

input:

7
7 6 3 6 3 6 3


output:

657

result:

ok 1 number(s): "657"

Test #2:

score: 0
Accepted
time: 3ms
memory: 19388kb

input:

10
9 5 2 9 4 1 8 2 10 9


output:

6600

result:

ok 1 number(s): "6600"

Test #3:

score: 0
Accepted
time: 3ms
memory: 19544kb

input:

15
13 13 13 7 13 13 13 13 13 13 13 14 9 13 13


output:

380931696

result:

ok 1 number(s): "380931696"

Test #4:

score: 0
Accepted
time: 2ms
memory: 19560kb

input:

15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


output:

56672664

result:

ok 1 number(s): "56672664"

Test #5:

score: 0
Accepted
time: 3ms
memory: 19484kb

input:

15
7 7 7 7 8 8 8 8 7 7 7 8 8 8 8


output:

377876427

result:

ok 1 number(s): "377876427"

Test #6:

score: 0
Accepted
time: 10ms
memory: 19492kb

input:

1
1

output:

1

result:

ok 1 number(s): "1"

Test #7:

score: 0
Accepted
time: 2ms
memory: 19412kb

input:

15
15 15 15 15 15 15 15 15 15 15 15 15 15 15 15

output:

384714192

result:

ok 1 number(s): "384714192"

Subtask #2:

score: 12
Accepted

Test #8:

score: 12
Accepted
time: 0ms
memory: 19432kb

input:

17
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

output:

211799312

result:

ok 1 number(s): "211799312"

Test #9:

score: 0
Accepted
time: 5ms
memory: 20148kb

input:

133
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

211020576

result:

ok 1 number(s): "211020576"

Test #10:

score: 0
Accepted
time: 45ms
memory: 51028kb

input:

1998
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

612186211

result:

ok 1 number(s): "612186211"

Test #11:

score: 0
Accepted
time: 0ms
memory: 27444kb

input:

799
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...

output:

164811484

result:

ok 1 number(s): "164811484"

Test #12:

score: 0
Accepted
time: 24ms
memory: 51092kb

input:

1999
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2...

output:

64870847

result:

ok 1 number(s): "64870847"

Subtask #3:

score: 23
Accepted

Test #13:

score: 23
Accepted
time: 269ms
memory: 66072kb

input:

2000
2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 2000 ...

output:

750925682

result:

ok 1 number(s): "750925682"

Test #14:

score: 0
Accepted
time: 294ms
memory: 61472kb

input:

2000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 ...

output:

333849364

result:

ok 1 number(s): "333849364"

Test #15:

score: 0
Accepted
time: 253ms
memory: 54876kb

input:

2000
333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333 333...

output:

391703579

result:

ok 1 number(s): "391703579"

Test #16:

score: 0
Accepted
time: 182ms
memory: 51708kb

input:

2000
50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50...

output:

184769713

result:

ok 1 number(s): "184769713"

Test #17:

score: 0
Accepted
time: 283ms
memory: 65800kb

input:

2000
1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 1998 ...

output:

750923681

result:

ok 1 number(s): "750923681"

Test #18:

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

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...

output:

1

result:

ok 1 number(s): "1"

Test #19:

score: 0
Accepted
time: 292ms
memory: 65640kb

input:

2000
1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 1777 ...

output:

22075503

result:

ok 1 number(s): "22075503"

Subtask #4:

score: 18
Accepted

Test #20:

score: 18
Accepted
time: 108ms
memory: 52684kb

input:

2000
399 18 3 4 4 32 141 185 2 10 15 130 35 708 3 763 20 2 882 1853 3 4 197 7 3 121 3 3 644 64 3 166...

output:

261183482

result:

ok 1 number(s): "261183482"

Test #21:

score: 0
Accepted
time: 101ms
memory: 52372kb

input:

2000
65 845 7 4 3 5 1352 85 2 7 18 28 9 3 27 1192 16 192 16 78 878 82 5 112 14 3 11 24 93 14 93 398 ...

output:

393933436

result:

ok 1 number(s): "393933436"

Test #22:

score: 0
Accepted
time: 109ms
memory: 52604kb

input:

2000
2 16 7 393 19 2 406 206 2 22 10 401 4 88 510 9 818 202 308 1078 40 7 13 705 10 5 7 38 188 9 40 ...

output:

786333240

result:

ok 1 number(s): "786333240"

Test #23:

score: 0
Accepted
time: 108ms
memory: 52588kb

input:

2000
115 2 82 99 222 39 8 101 46 184 2 13 8 3 140 50 33 6 83 109 3 2 41 477 1795 3 351 408 135 2 33 ...

output:

46975065

result:

ok 1 number(s): "46975065"

Test #24:

score: 0
Accepted
time: 101ms
memory: 52664kb

input:

2000
9 33 27 2 7 29 2 949 15 4 809 2 1910 21 564 11 39 201 4 45 111 888 52 8 4 1095 41 34 62 24 25 4...

output:

124499081

result:

ok 1 number(s): "124499081"

Test #25:

score: 0
Accepted
time: 109ms
memory: 52576kb

input:

2000
215 1471 2 21 475 15 79 13 5 214 106 1657 64 849 8 184 247 5 501 204 411 361 195 29 43 763 33 1...

output:

971398185

result:

ok 1 number(s): "971398185"

Test #26:

score: 0
Accepted
time: 104ms
memory: 52592kb

input:

2000
10 31 1961 3 5 68 169 5 130 2 96 221 8 15 1136 3 1332 13 889 2 24 5 2 25 586 3 4 8 304 6 9 859 ...

output:

377962615

result:

ok 1 number(s): "377962615"

Test #27:

score: 0
Accepted
time: 114ms
memory: 52448kb

input:

2000
47 45 6 8 93 377 2 12 410 90 4 215 321 4 130 4 3 1190 2 4 12 14 371 2 191 7 28 3 2 52 59 7 4 54...

output:

456938485

result:

ok 1 number(s): "456938485"

Test #28:

score: 0
Accepted
time: 153ms
memory: 51648kb

input:

2000
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10...

output:

372553909

result:

ok 1 number(s): "372553909"

Test #29:

score: 0
Accepted
time: 224ms
memory: 65228kb

input:

2000
332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332 332...

output:

915628630

result:

ok 1 number(s): "915628630"

Test #30:

score: 0
Accepted
time: 257ms
memory: 57720kb

input:

2000
839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839 839...

output:

140106173

result:

ok 1 number(s): "140106173"

Test #31:

score: 0
Accepted
time: 239ms
memory: 62528kb

input:

2000
147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147 147...

output:

844601499

result:

ok 1 number(s): "844601499"

Test #32:

score: 0
Accepted
time: 230ms
memory: 60392kb

input:

2000
1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 1043 ...

output:

197212701

result:

ok 1 number(s): "197212701"

Test #33:

score: 0
Accepted
time: 265ms
memory: 62592kb

input:

2000
1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 1269 ...

output:

132433582

result:

ok 1 number(s): "132433582"

Test #34:

score: 0
Accepted
time: 254ms
memory: 64248kb

input:

2000
1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 1450 ...

output:

555602406

result:

ok 1 number(s): "555602406"

Test #35:

score: 0
Accepted
time: 237ms
memory: 63888kb

input:

2000
1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 1424 ...

output:

338170032

result:

ok 1 number(s): "338170032"

Test #36:

score: 0
Accepted
time: 261ms
memory: 65508kb

input:

2000
1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 1655 ...

output:

916736173

result:

ok 1 number(s): "916736173"

Subtask #5:

score: 24
Accepted

Test #37:

score: 24
Accepted
time: 227ms
memory: 59192kb

input:

2000
886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886 886...

output:

98739085

result:

ok 1 number(s): "98739085"

Test #38:

score: 0
Accepted
time: 7ms
memory: 19936kb

input:

100
45 28 13 9 12 32 5 13 47 5 17 52 4 3 82 21 4 5 5 43 10 60 3 95 91 48 98 8 12 4 6 15 88 56 5 44 6...

output:

716930637

result:

ok 1 number(s): "716930637"

Test #39:

score: 0
Accepted
time: 2ms
memory: 19860kb

input:

100
4 70 22 81 32 63 4 49 85 73 24 79 25 3 5 15 4 12 81 13 13 2 2 34 2 2 23 3 2 25 7 12 26 2 72 7 2 ...

output:

855344261

result:

ok 1 number(s): "855344261"

Test #40:

score: 0
Accepted
time: 1ms
memory: 19980kb

input:

100
16 91 3 37 11 25 55 91 6 4 21 62 29 85 3 2 46 10 5 40 49 9 4 6 7 56 2 6 24 2 33 35 92 24 42 6 2 ...

output:

437250457

result:

ok 1 number(s): "437250457"

Test #41:

score: 0
Accepted
time: 3ms
memory: 19840kb

input:

100
9 86 27 83 71 97 52 16 22 2 28 70 61 2 5 15 82 37 30 64 34 44 43 2 52 4 3 33 15 70 46 12 4 2 3 5...

output:

798956636

result:

ok 1 number(s): "798956636"

Test #42:

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

input:

100
2 4 25 60 16 16 89 59 17 76 32 2 43 63 86 5 2 62 79 2 20 55 27 3 10 47 17 17 52 28 32 20 83 20 6...

output:

781288572

result:

ok 1 number(s): "781288572"

Test #43:

score: 0
Accepted
time: 3ms
memory: 19904kb

input:

100
2 79 63 4 73 90 6 8 3 88 44 65 52 3 86 37 70 6 39 5 33 4 63 8 16 100 71 18 77 5 11 77 67 4 3 9 6...

output:

361985366

result:

ok 1 number(s): "361985366"

Test #44:

score: 0
Accepted
time: 5ms
memory: 19840kb

input:

100
99 97 7 2 82 4 12 16 19 2 2 33 39 9 35 2 4 82 2 31 77 26 2 2 79 2 98 71 2 7 51 96 2 67 4 27 2 16...

output:

549310985

result:

ok 1 number(s): "549310985"

Test #45:

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

input:

100
37 11 44 44 37 89 8 18 8 4 8 2 12 8 9 75 44 4 3 86 5 33 11 94 16 88 62 11 2 42 17 9 4 3 99 9 3 2...

output:

361748618

result:

ok 1 number(s): "361748618"

Test #46:

score: 0
Accepted
time: 2ms
memory: 19984kb

input:

100
42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 ...

output:

943698880

result:

ok 1 number(s): "943698880"

Test #47:

score: 0
Accepted
time: 3ms
memory: 19956kb

input:

100
14 14 14 14 14 14 14 14 14 14 14 14 14 14 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 ...

output:

62621141

result:

ok 1 number(s): "62621141"

Test #48:

score: 0
Accepted
time: 5ms
memory: 20020kb

input:

100
55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 55 ...

output:

652178966

result:

ok 1 number(s): "652178966"

Test #49:

score: 0
Accepted
time: 2ms
memory: 19904kb

input:

100
45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 45 ...

output:

993532437

result:

ok 1 number(s): "993532437"

Test #50:

score: 0
Accepted
time: 0ms
memory: 19880kb

input:

100
57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 57 ...

output:

483641368

result:

ok 1 number(s): "483641368"

Test #51:

score: 0
Accepted
time: 7ms
memory: 19956kb

input:

100
79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 79 ...

output:

359441590

result:

ok 1 number(s): "359441590"

Test #52:

score: 0
Accepted
time: 3ms
memory: 19980kb

input:

100
100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 ...

output:

142398910

result:

ok 1 number(s): "142398910"

Test #53:

score: 0
Accepted
time: 7ms
memory: 19920kb

input:

100
30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 ...

output:

584268175

result:

ok 1 number(s): "584268175"

Test #54:

score: 0
Accepted
time: 3ms
memory: 19924kb

input:

100
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5 6 6 6 6 6 6 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 10 10 ...

output:

859265062

result:

ok 1 number(s): "859265062"