結果

問題 No.1532 Different Products
ユーザー chocoruskchocorusk
提出日時 2021-06-04 20:06:10
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2,696 ms / 4,000 ms
コード長 979 bytes
コンパイル時間 4,012 ms
コンパイル使用メモリ 196,112 KB
実行使用メモリ 14,516 KB
最終ジャッジ日時 2023-08-12 08:40:46
合計ジャッジ時間 73,068 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 194 ms
6,520 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 3 ms
4,380 KB
testcase_08 AC 4 ms
4,380 KB
testcase_09 AC 36 ms
5,216 KB
testcase_10 AC 201 ms
7,788 KB
testcase_11 AC 146 ms
7,264 KB
testcase_12 AC 633 ms
10,460 KB
testcase_13 AC 250 ms
9,496 KB
testcase_14 AC 1,651 ms
12,712 KB
testcase_15 AC 5 ms
4,380 KB
testcase_16 AC 320 ms
6,644 KB
testcase_17 AC 148 ms
7,332 KB
testcase_18 AC 84 ms
6,964 KB
testcase_19 AC 572 ms
10,604 KB
testcase_20 AC 1,598 ms
13,068 KB
testcase_21 AC 454 ms
7,576 KB
testcase_22 AC 290 ms
8,944 KB
testcase_23 AC 112 ms
7,700 KB
testcase_24 AC 1,223 ms
12,488 KB
testcase_25 AC 590 ms
9,600 KB
testcase_26 AC 50 ms
5,036 KB
testcase_27 AC 624 ms
8,412 KB
testcase_28 AC 399 ms
7,896 KB
testcase_29 AC 425 ms
6,516 KB
testcase_30 AC 891 ms
9,496 KB
testcase_31 AC 905 ms
9,536 KB
testcase_32 AC 1,119 ms
10,340 KB
testcase_33 AC 771 ms
9,096 KB
testcase_34 AC 1,204 ms
11,880 KB
testcase_35 AC 1,012 ms
10,348 KB
testcase_36 AC 1,212 ms
11,524 KB
testcase_37 AC 231 ms
5,104 KB
testcase_38 AC 1,361 ms
12,036 KB
testcase_39 AC 1,190 ms
11,232 KB
testcase_40 AC 1,154 ms
11,288 KB
testcase_41 AC 1,869 ms
13,980 KB
testcase_42 AC 1,545 ms
13,064 KB
testcase_43 AC 1,671 ms
13,412 KB
testcase_44 AC 1,777 ms
14,276 KB
testcase_45 AC 1,779 ms
14,188 KB
testcase_46 AC 1,743 ms
13,928 KB
testcase_47 AC 1,725 ms
14,408 KB
testcase_48 AC 1,726 ms
14,412 KB
testcase_49 AC 1,718 ms
14,336 KB
testcase_50 AC 1,814 ms
14,208 KB
testcase_51 AC 2,016 ms
14,348 KB
testcase_52 AC 2,188 ms
14,056 KB
testcase_53 AC 2,109 ms
14,516 KB
testcase_54 AC 1,842 ms
14,068 KB
testcase_55 AC 1,746 ms
14,184 KB
testcase_56 AC 1,987 ms
14,020 KB
testcase_57 AC 2,298 ms
13,992 KB
testcase_58 AC 2,139 ms
14,116 KB
testcase_59 AC 2,696 ms
13,688 KB
testcase_60 AC 2,553 ms
14,408 KB
testcase_61 AC 1 ms
4,384 KB
testcase_62 AC 2 ms
4,384 KB
testcase_63 AC 2,567 ms
14,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#include <list>
#include <atcoder/all>
#define popcount __builtin_popcount
using namespace std;
using namespace atcoder;
typedef long long ll;
typedef pair<int, int> P;
using ull=unsigned long long;
map<ll, ull> dp;
int main()
{
    int n;
    ll k;
    cin>>n>>k;
    dp[k]=1;
    for(int i=1; i<=n; i++){
        map<ll, ull> ndp=dp;
        for(auto p:dp){
            if(p.first>=i) ndp[p.first/i]+=p.second;
        }
        swap(dp, ndp);
    }
    ull ans=0;
    for(auto p:dp) ans+=p.second;
    ans--;
    cout<<ans<<endl;
    return 0;
}
0