結果
| 問題 | No.741 AscNumber(Easy) |
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2021-02-19 04:23:41 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 458 bytes |
| 記録 | |
| コンパイル時間 | 491 ms |
| コンパイル使用メモリ | 86,892 KB |
| 実行使用メモリ | 13,056 KB |
| 最終ジャッジ日時 | 2026-04-04 18:39:10 |
| 合計ジャッジ時間 | 4,713 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 TLE * 1 -- * 19 |
ソースコード
#include<iostream>
#include<map>
using namespace std;
using ll=long long;
ll mod=1e9+7;
map<pair<int,int>,ll> Memo;
ll f(int x,int n){
if (n==1) return 1;
if (Memo.count(make_pair(x,n))==1) return Memo[make_pair(x,n)];
ll A=0;
for (int i=0;i<=x;i++) A+=f(i,n-1);
A%=mod;
return Memo[make_pair(x,n)]=A;
}
int main(){
int N;
cin >> N;
ll X=0;
for (int i=0;i<=9;i++) X+=f(i,N);
cout << X%mod << endl;
}
Kazun