結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 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 1 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 3 ms
4,360 KB
testcase_10 AC 2 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 305 ms
125,196 KB
testcase_15 AC 318 ms
131,212 KB
testcase_16 AC 318 ms
131,212 KB
testcase_17 AC 317 ms
131,212 KB
testcase_18 AC 318 ms
131,212 KB
testcase_19 AC 320 ms
131,212 KB
testcase_20 AC 108 ms
131,212 KB
testcase_21 AC 99 ms
115,596 KB
testcase_22 AC 107 ms
128,908 KB
testcase_23 AC 115 ms
128,908 KB
testcase_24 AC 108 ms
128,908 KB
testcase_25 AC 105 ms
127,500 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 AC 160 ms
95,244 KB
testcase_28 AC 68 ms
41,868 KB
testcase_29 AC 46 ms
42,508 KB
testcase_30 AC 92 ms
61,068 KB
testcase_31 AC 136 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;
	}
}
m=~m;

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