結果

問題 No.1631 Sorting Integers (Multiple of K) Easy
ユーザー tailstails
提出日時 2023-03-09 10:41:09
言語 cLay
(20240104-1)
結果
AC  
実行時間 388 ms / 3,000 ms
コード長 272 bytes
コンパイル時間 2,412 ms
コンパイル使用メモリ 175,140 KB
実行使用メモリ 131,212 KB
最終ジャッジ日時 2023-10-18 06:13:16
合計ジャッジ時間 7,028 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 5 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 4 ms
4,360 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 369 ms
125,196 KB
testcase_15 AC 387 ms
131,212 KB
testcase_16 AC 385 ms
131,212 KB
testcase_17 AC 384 ms
131,212 KB
testcase_18 AC 385 ms
131,212 KB
testcase_19 AC 388 ms
131,212 KB
testcase_20 AC 111 ms
131,212 KB
testcase_21 AC 107 ms
115,596 KB
testcase_22 AC 113 ms
128,908 KB
testcase_23 AC 128 ms
128,908 KB
testcase_24 AC 118 ms
128,908 KB
testcase_25 AC 115 ms
127,500 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 200 ms
95,244 KB
testcase_28 AC 85 ms
41,868 KB
testcase_29 AC 54 ms
42,508 KB
testcase_30 AC 114 ms
61,068 KB
testcase_31 AC 168 ms
94,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ll d[1<<n][k]{};
d[(1<<n)-1][0]=1;
rrep(i,(1<<n)-1){
	if(!(i&~i<<1&~m)){
		rep(j,n){
			if(~i&1<<j){
				rep(l,k){
					d[i][(l*10+h[j])%k]+=d[i|1<<j][l];
				}
			}
		}
	}
}
wt(d[0][0]);
0