結果

問題 No.1532 Different Products
ユーザー asaringoasaringo
提出日時 2021-06-05 15:55:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 657 ms / 4,000 ms
コード長 602 bytes
コンパイル時間 1,821 ms
コンパイル使用メモリ 176,168 KB
実行使用メモリ 12,040 KB
最終ジャッジ日時 2024-05-01 10:12:33
合計ジャッジ時間 22,922 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 96 ms
5,576 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 28 ms
5,376 KB
testcase_10 AC 119 ms
6,076 KB
testcase_11 AC 89 ms
5,716 KB
testcase_12 AC 293 ms
8,084 KB
testcase_13 AC 150 ms
7,696 KB
testcase_14 AC 459 ms
9,368 KB
testcase_15 AC 6 ms
5,376 KB
testcase_16 AC 105 ms
5,504 KB
testcase_17 AC 90 ms
5,976 KB
testcase_18 AC 61 ms
5,800 KB
testcase_19 AC 278 ms
8,176 KB
testcase_20 AC 464 ms
9,324 KB
testcase_21 AC 150 ms
5,916 KB
testcase_22 AC 180 ms
7,552 KB
testcase_23 AC 82 ms
6,180 KB
testcase_24 AC 429 ms
9,040 KB
testcase_25 AC 230 ms
7,636 KB
testcase_26 AC 30 ms
5,376 KB
testcase_27 AC 203 ms
6,492 KB
testcase_28 AC 155 ms
6,224 KB
testcase_29 AC 150 ms
5,584 KB
testcase_30 AC 272 ms
7,532 KB
testcase_31 AC 272 ms
7,556 KB
testcase_32 AC 329 ms
8,064 KB
testcase_33 AC 256 ms
7,676 KB
testcase_34 AC 410 ms
8,704 KB
testcase_35 AC 317 ms
7,944 KB
testcase_36 AC 387 ms
8,704 KB
testcase_37 AC 93 ms
5,376 KB
testcase_38 AC 426 ms
8,804 KB
testcase_39 AC 375 ms
8,428 KB
testcase_40 AC 378 ms
8,688 KB
testcase_41 AC 536 ms
9,820 KB
testcase_42 AC 473 ms
9,320 KB
testcase_43 AC 504 ms
9,608 KB
testcase_44 AC 611 ms
11,968 KB
testcase_45 AC 624 ms
11,880 KB
testcase_46 AC 597 ms
9,856 KB
testcase_47 AC 657 ms
11,900 KB
testcase_48 AC 642 ms
11,884 KB
testcase_49 AC 651 ms
11,904 KB
testcase_50 AC 617 ms
12,040 KB
testcase_51 AC 598 ms
11,884 KB
testcase_52 AC 556 ms
11,896 KB
testcase_53 AC 606 ms
12,028 KB
testcase_54 AC 556 ms
12,028 KB
testcase_55 AC 549 ms
11,900 KB
testcase_56 AC 581 ms
9,852 KB
testcase_57 AC 553 ms
9,956 KB
testcase_58 AC 573 ms
12,028 KB
testcase_59 AC 530 ms
9,704 KB
testcase_60 AC 584 ms
11,920 KB
testcase_61 AC 2 ms
5,376 KB
testcase_62 AC 2 ms
5,376 KB
testcase_63 AC 604 ms
11,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
#define rep(i,n) for(int i = 0 ; i < n ; i++)
#define rrep(i,a,b) for(int i = a ; i < b ; i++)

int main() {
    ll n, k ;
    cin >> n >> k ;
    unordered_map<ll, ll> dp ;
    dp[k] = 1 ;
    for(int i = n ; i > 0 ; i--)
        for (auto it : unordered_map<ll, ll>(dp)){
            ll x = it.first , y = it.second ;
            dp[x/i] += y ;
        }
    ll ans = -1 ;
    for (auto it : dp){
        ll x = it.first , y = it.second ; 
        if(x == 0) continue ;
        if (x) ans += y ;
    }
    cout << ans << endl ;
}
0