Submission #1260141


Source Code Expand

char m['  '];
a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
main(d){
*a=scanf("%d ",&d);
for(n=strlen(gets(m));i<n;) s += m[i++] -= 48;
for(m[n-1]++;i--;) {
  s -= k=m[i];
  for(s%=d; k--; g %= M) g += a[(s+k+d)%d];
  for(; j < d; j++)
    for(k=10; k--; b[j] %= M) b[j] += a[(j+k)%d];
  for(;j--;b[j]=0)a[j]=b[j];
}
printf("%d\n",g);
g=0;
}

Submission Info

Submission Time
Task E - 数
User akouryy
Language C (GCC 5.4.1)
Score 4
Code Size 349 Byte
Status AC
Exec Time 61 ms
Memory 128 KB

Compile Error

./Main.c:1:8: warning: multi-character character constant [-Wmultichar]
 char m['  '];
        ^
./Main.c:2:1: warning: data definition has no type or storage class
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
 ^
./Main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘a’ [-Wimplicit-int]
./Main.c:2:8: warning: type defaults to ‘int’ in declaration of ‘b’ [-Wimplicit-int]
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
        ^
./Main.c:2:15: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int]
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
               ^
./Main.c:2:17: warning: type defaults to ‘int’ in declaration of ‘j’ [-Wimplicit-int]
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
                 ^
./Main.c:2:19: warning: type defaults to ‘int’ in declaration of ‘g’ [-Wimplicit-int]
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
                   ^
./Main.c:2:24: warning: type defaults to ‘int’ in declaration of ‘s’ [-Wimplicit-int]
 a[110],b[110],i,j,g=-1,s=1,M=1e9+7,k,n;
                      ...

Judge Result

Set Name All
Score / Max Score 4 / 4
Status
AC × 5
Set Name Test Cases
All 00, 01, 02, 90, 91
Case Name Status Exec Time Memory
00 AC 1 ms 128 KB
01 AC 37 ms 128 KB
02 AC 61 ms 128 KB
90 AC 1 ms 128 KB
91 AC 1 ms 128 KB