結果
| 問題 | No.1532 Different Products |
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-08-14 16:36:22 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 455 bytes |
| 記録 | |
| コンパイル時間 | 1,141 ms |
| コンパイル使用メモリ | 191,204 KB |
| 実行使用メモリ | 360,704 KB |
| 最終ジャッジ日時 | 2026-09-10 15:53:25 |
| 合計ジャッジ時間 | 22,661 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 11 TLE * 2 -- * 49 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
map<vector<long long>,long long> m;
long long calc(long long N,long long K){
if(m.count({N,K})){
return m[{N,K}];
}
if(N==1){
return 1;
}
if(N<=K){
m[{N,K}]=calc(N-1,K/N)+1+calc(N-1,K);
return m[{N,K}];
}else{
m[{N,K}]=calc(N-1,K);
return m[{N,K}];
}
}
int main(){
long long N,K;
cin>>N>>K;
cout<<calc(N,K)<<endl;;
}
ytft