結果

問題 No.1532 Different Products
ユーザー tailstails
提出日時 2021-06-04 21:54:25
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,022 ms / 4,000 ms
コード長 337 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 60,432 KB
実行使用メモリ 13,992 KB
最終ジャッジ日時 2023-08-12 12:43:31
合計ジャッジ時間 34,108 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 138 ms
6,184 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 4 ms
4,376 KB
testcase_09 AC 40 ms
4,964 KB
testcase_10 AC 171 ms
7,288 KB
testcase_11 AC 125 ms
6,780 KB
testcase_12 AC 415 ms
10,092 KB
testcase_13 AC 198 ms
8,988 KB
testcase_14 AC 697 ms
12,340 KB
testcase_15 AC 6 ms
4,380 KB
testcase_16 AC 157 ms
6,068 KB
testcase_17 AC 124 ms
7,056 KB
testcase_18 AC 84 ms
6,584 KB
testcase_19 AC 420 ms
10,224 KB
testcase_20 AC 723 ms
12,592 KB
testcase_21 AC 231 ms
7,008 KB
testcase_22 AC 241 ms
8,708 KB
testcase_23 AC 116 ms
7,372 KB
testcase_24 AC 654 ms
12,092 KB
testcase_25 AC 360 ms
9,192 KB
testcase_26 AC 44 ms
4,620 KB
testcase_27 AC 306 ms
7,904 KB
testcase_28 AC 238 ms
7,540 KB
testcase_29 AC 216 ms
6,176 KB
testcase_30 AC 432 ms
9,064 KB
testcase_31 AC 421 ms
9,132 KB
testcase_32 AC 482 ms
9,952 KB
testcase_33 AC 390 ms
8,648 KB
testcase_34 AC 595 ms
11,292 KB
testcase_35 AC 474 ms
9,984 KB
testcase_36 AC 592 ms
11,196 KB
testcase_37 AC 138 ms
4,804 KB
testcase_38 AC 626 ms
11,644 KB
testcase_39 AC 545 ms
10,872 KB
testcase_40 AC 558 ms
11,052 KB
testcase_41 AC 827 ms
13,640 KB
testcase_42 AC 718 ms
12,668 KB
testcase_43 AC 793 ms
13,056 KB
testcase_44 AC 859 ms
13,860 KB
testcase_45 AC 953 ms
13,820 KB
testcase_46 AC 981 ms
13,548 KB
testcase_47 AC 876 ms
13,992 KB
testcase_48 AC 912 ms
13,880 KB
testcase_49 AC 996 ms
13,860 KB
testcase_50 AC 877 ms
13,856 KB
testcase_51 AC 873 ms
13,912 KB
testcase_52 AC 880 ms
13,760 KB
testcase_53 AC 874 ms
13,968 KB
testcase_54 AC 842 ms
13,720 KB
testcase_55 AC 860 ms
13,860 KB
testcase_56 AC 940 ms
13,556 KB
testcase_57 AC 892 ms
13,664 KB
testcase_58 AC 875 ms
13,824 KB
testcase_59 AC 836 ms
13,312 KB
testcase_60 AC 1,022 ms
13,984 KB
testcase_61 AC 1 ms
4,376 KB
testcase_62 AC 1 ms
4,376 KB
testcase_63 AC 850 ms
13,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <map>

int main(){
	long n,k;
	std::scanf("%ld",&n);
	std::scanf("%ld",&k);
	std::map<long,long> h;
	h[k]=1;
	for(long i=n;i>=2;--i){
		std::map<long,long> d=h;
		for(auto v:h){
			long a=v.first/i;
			d[a]+=v.second;
		}
		h=d;
	}
	h[0]=0;
	long t=0;
	for(auto v:h){
		t+=v.second;
	}
	printf("%ld",t*2-1);
}
0