Submission #6591877


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9+7;
 void add(ll& a, ll b)
 {
 	a+=b;
 	if(a>=mod)
 		a-=mod;
 }
int main()
{
	string s;
	cin>>s;
	ll dp[100005][13];
	
	dp[0][0] = 1;
	int n  = s.size();
	for(int i =0 ; i < n ; i++)
	{

		if(s[i]!='?')
		{
			for(int k = 0 ; k < 13; k++)
				add(dp[i+1][(k*10 + (int)(s[i]-'0'))%13], dp[i][k]);
			
		}
		else
		{
			for(int j = 0 ; j<10; j++)
				for(int k = 0 ; k < 13; k++)
				    add(dp[i+1][(k*10+j)%13], dp[i][k]);
		}
	}
	cout<<dp[n][5]<<endl;

}

Submission Info

Submission Time
Task D - Digits Parade
User the_fireswan
Language C++14 (GCC 5.4.1)
Score 0
Code Size 582 Byte
Status WA
Exec Time 64 ms
Memory 10624 KB

Judge Result

Set Name Sample Subtask1
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
AC × 22
WA × 8
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt, sub1_01.txt, sub1_02.txt, sub1_03.txt, sub1_04.txt, sub1_05.txt, sub1_06.txt, sub1_07.txt, sub1_08.txt, sub1_09.txt, sub1_10.txt, sub1_11.txt, sub1_12.txt, sub1_13.txt, sub1_14.txt, sub1_15.txt, sub1_16.txt, sub1_17.txt, sub1_18.txt, sub1_19.txt, sub1_20.txt, sub1_21.txt, sub1_22.txt, sub1_23.txt, sub1_24.txt, sub1_25.txt, sub1_26.txt
Case Name Status Exec Time Memory
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB
sample_04.txt AC 1 ms 256 KB
sub1_01.txt AC 26 ms 4864 KB
sub1_02.txt AC 35 ms 6656 KB
sub1_03.txt AC 1 ms 256 KB
sub1_04.txt AC 1 ms 256 KB
sub1_05.txt AC 30 ms 5632 KB
sub1_06.txt AC 1 ms 256 KB
sub1_07.txt AC 2 ms 512 KB
sub1_08.txt AC 16 ms 10624 KB
sub1_09.txt AC 57 ms 10496 KB
sub1_10.txt AC 44 ms 7552 KB
sub1_11.txt AC 1 ms 256 KB
sub1_12.txt AC 1 ms 256 KB
sub1_13.txt AC 1 ms 256 KB
sub1_14.txt AC 1 ms 256 KB
sub1_15.txt AC 1 ms 256 KB
sub1_16.txt AC 1 ms 256 KB
sub1_17.txt WA 40 ms 10624 KB
sub1_18.txt WA 30 ms 10624 KB
sub1_19.txt WA 61 ms 10624 KB
sub1_20.txt WA 64 ms 10624 KB
sub1_21.txt WA 12 ms 10624 KB
sub1_22.txt WA 12 ms 10624 KB
sub1_23.txt WA 12 ms 10624 KB
sub1_24.txt WA 61 ms 10624 KB
sub1_25.txt AC 1 ms 256 KB
sub1_26.txt AC 1 ms 256 KB