結果

問題 No.1631 Sorting Integers (Multiple of K) Easy
ユーザー tailstails
提出日時 2023-03-09 10:28:11
言語 cLay
(20240104-1)
結果
AC  
実行時間 1,275 ms / 3,000 ms
コード長 240 bytes
コンパイル時間 3,787 ms
コンパイル使用メモリ 174,684 KB
実行使用メモリ 131,212 KB
最終ジャッジ日時 2023-10-18 06:13:07
合計ジャッジ時間 23,969 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 5 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 5 ms
4,372 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 3 ms
4,348 KB
testcase_12 AC 3 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1,219 ms
125,196 KB
testcase_15 AC 1,275 ms
131,212 KB
testcase_16 AC 1,268 ms
131,212 KB
testcase_17 AC 1,268 ms
131,212 KB
testcase_18 AC 1,267 ms
131,212 KB
testcase_19 AC 1,267 ms
131,212 KB
testcase_20 AC 1,272 ms
131,212 KB
testcase_21 AC 1,117 ms
115,596 KB
testcase_22 AC 1,245 ms
128,908 KB
testcase_23 AC 1,243 ms
128,908 KB
testcase_24 AC 1,245 ms
128,908 KB
testcase_25 AC 1,232 ms
127,500 KB
testcase_26 AC 4 ms
4,348 KB
testcase_27 AC 913 ms
95,244 KB
testcase_28 AC 383 ms
41,868 KB
testcase_29 AC 390 ms
42,508 KB
testcase_30 AC 575 ms
61,068 KB
testcase_31 AC 911 ms
94,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,@k,h[n]{},f=1;
n=0;
rep(i,1,10){
	ll@c;
	rep(j,c){
		h[n++]=i;
		f*=j+1;
	}
}

ll d[1<<n][k]{};
d[0][0]=1;
rep(i,1,1<<n){
	rep(j,n){
		if(i&1<<j){
			rep(l,k){
				d[i][(l*10+h[j])%k]+=d[i^1<<j][l];
			}
		}
	}
}
wt(d[(1<<n)-1][0]/f);
0