結果
| 問題 | No.1532 Different Products |
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2021-06-04 20:06:10 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1,594 ms / 4,000 ms |
| コード長 | 979 bytes |
| コンパイル時間 | 3,172 ms |
| コンパイル使用メモリ | 188,912 KB |
| 最終ジャッジ日時 | 2025-01-21 21:32:53 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 62 |
ソースコード
#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;
}
chocorusk