結果
| 問題 |
No.1532 Different Products
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-05 15:13:06 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 635 ms / 4,000 ms |
| コード長 | 584 bytes |
| コンパイル時間 | 1,781 ms |
| コンパイル使用メモリ | 177,560 KB |
| 実行使用メモリ | 12,036 KB |
| 最終ジャッジ日時 | 2024-11-21 13:05:48 |
| 合計ジャッジ時間 | 22,134 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 62 |
ソースコード
#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 ;
if (x >= i) dp[x/i] += y ;
}
ll ans = -1 ;
for (auto it : dp){
ll x = it.first , y = it.second ;
if (x) ans += y ;
}
cout << ans << endl ;
}