Submission #59499847


Source Code Expand

#include<bits/stdc++.h>
#include"atcoder/all"
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
typedef long long ll;
typedef vector<ll> vi;
constexpr ll mod = 1000000007;
typedef modint1000000007 mi;
int main(){
    int k;cin>>k;
    if(k%9){
        cout<<0<<endl;
    }
    else{
        vector<mi>dp(k+1);
        dp[0]=1;
        for(int i=0;i<k;i++){
            for(int j=1;j<=9;j++){
                if(i+j<=k)dp[i+j]+=dp[i];
            }
        }
        cout<<dp[k].val()<<endl;
    }
}

Submission Info

Submission Time
Task 042 - Multiple of 9(★4)
User Rho17
Language C++ 20 (gcc 12.2)
Score 4
Code Size 590 Byte
Status AC
Exec Time 2 ms
Memory 3672 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 4 / 4
Status
AC × 2
AC × 62
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt
All 00_sample_00.txt, 00_sample_01.txt, 10_small_00.txt, 10_small_01.txt, 10_small_02.txt, 10_small_03.txt, 10_small_04.txt, 10_small_05.txt, 10_small_06.txt, 10_small_07.txt, 10_small_08.txt, 10_small_09.txt, 10_small_10.txt, 10_small_11.txt, 10_small_12.txt, 10_small_13.txt, 10_small_14.txt, 10_small_15.txt, 10_small_16.txt, 10_small_17.txt, 10_small_18.txt, 10_small_19.txt, 11_large_00.txt, 11_large_01.txt, 11_large_02.txt, 11_large_03.txt, 11_large_04.txt, 11_large_05.txt, 11_large_06.txt, 11_large_07.txt, 11_large_08.txt, 11_large_09.txt, 11_large_10.txt, 11_large_11.txt, 11_large_12.txt, 11_large_13.txt, 11_large_14.txt, 11_large_15.txt, 11_large_16.txt, 11_large_17.txt, 11_large_18.txt, 11_large_19.txt, 99_hand_00.txt, 99_hand_01.txt, 99_hand_02.txt, 99_hand_03.txt, 99_hand_04.txt, 99_hand_05.txt, 99_hand_06.txt, 99_hand_07.txt, 99_hand_08.txt, 99_hand_09.txt, 99_hand_10.txt, 99_hand_11.txt, 99_hand_12.txt, 99_hand_13.txt, 99_hand_14.txt, 99_hand_15.txt, 99_hand_16.txt, 99_hand_17.txt, 99_hand_18.txt, 99_hand_19.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3452 KiB
00_sample_01.txt AC 1 ms 3508 KiB
10_small_00.txt AC 1 ms 3472 KiB
10_small_01.txt AC 1 ms 3504 KiB
10_small_02.txt AC 1 ms 3456 KiB
10_small_03.txt AC 1 ms 3540 KiB
10_small_04.txt AC 1 ms 3508 KiB
10_small_05.txt AC 1 ms 3360 KiB
10_small_06.txt AC 1 ms 3512 KiB
10_small_07.txt AC 1 ms 3568 KiB
10_small_08.txt AC 1 ms 3508 KiB
10_small_09.txt AC 1 ms 3576 KiB
10_small_10.txt AC 1 ms 3452 KiB
10_small_11.txt AC 1 ms 3384 KiB
10_small_12.txt AC 1 ms 3512 KiB
10_small_13.txt AC 1 ms 3544 KiB
10_small_14.txt AC 1 ms 3592 KiB
10_small_15.txt AC 1 ms 3672 KiB
10_small_16.txt AC 1 ms 3456 KiB
10_small_17.txt AC 1 ms 3512 KiB
10_small_18.txt AC 1 ms 3476 KiB
10_small_19.txt AC 1 ms 3484 KiB
11_large_00.txt AC 1 ms 3452 KiB
11_large_01.txt AC 1 ms 3412 KiB
11_large_02.txt AC 1 ms 3500 KiB
11_large_03.txt AC 1 ms 3452 KiB
11_large_04.txt AC 2 ms 3496 KiB
11_large_05.txt AC 1 ms 3508 KiB
11_large_06.txt AC 1 ms 3476 KiB
11_large_07.txt AC 1 ms 3356 KiB
11_large_08.txt AC 1 ms 3664 KiB
11_large_09.txt AC 2 ms 3532 KiB
11_large_10.txt AC 1 ms 3540 KiB
11_large_11.txt AC 1 ms 3508 KiB
11_large_12.txt AC 1 ms 3452 KiB
11_large_13.txt AC 1 ms 3536 KiB
11_large_14.txt AC 1 ms 3472 KiB
11_large_15.txt AC 1 ms 3472 KiB
11_large_16.txt AC 1 ms 3508 KiB
11_large_17.txt AC 1 ms 3376 KiB
11_large_18.txt AC 1 ms 3472 KiB
11_large_19.txt AC 1 ms 3380 KiB
99_hand_00.txt AC 1 ms 3384 KiB
99_hand_01.txt AC 1 ms 3672 KiB
99_hand_02.txt AC 1 ms 3576 KiB
99_hand_03.txt AC 2 ms 3468 KiB
99_hand_04.txt AC 1 ms 3480 KiB
99_hand_05.txt AC 1 ms 3472 KiB
99_hand_06.txt AC 1 ms 3480 KiB
99_hand_07.txt AC 1 ms 3480 KiB
99_hand_08.txt AC 1 ms 3584 KiB
99_hand_09.txt AC 1 ms 3508 KiB
99_hand_10.txt AC 1 ms 3508 KiB
99_hand_11.txt AC 1 ms 3500 KiB
99_hand_12.txt AC 1 ms 3428 KiB
99_hand_13.txt AC 1 ms 3496 KiB
99_hand_14.txt AC 1 ms 3452 KiB
99_hand_15.txt AC 1 ms 3452 KiB
99_hand_16.txt AC 1 ms 3536 KiB
99_hand_17.txt AC 1 ms 3452 KiB
99_hand_18.txt AC 1 ms 3388 KiB
99_hand_19.txt AC 1 ms 3456 KiB