結果
問題 | No.372 It's automatic |
ユーザー | 👑 testestest |
提出日時 | 2016-10-24 19:16:15 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2,708 ms / 6,000 ms |
コード長 | 328 bytes |
コンパイル時間 | 577 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-24 02:47:29 |
合計ジャッジ時間 | 34,400 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,816 KB |
testcase_01 | AC | 0 ms
6,820 KB |
testcase_02 | AC | 0 ms
6,824 KB |
testcase_03 | AC | 0 ms
6,820 KB |
testcase_04 | AC | 2,681 ms
6,816 KB |
testcase_05 | AC | 2,708 ms
6,820 KB |
testcase_06 | AC | 2,681 ms
6,820 KB |
testcase_07 | AC | 2,679 ms
6,820 KB |
testcase_08 | AC | 2,678 ms
6,820 KB |
testcase_09 | AC | 2,680 ms
6,816 KB |
testcase_10 | AC | 2,679 ms
6,816 KB |
testcase_11 | AC | 2,655 ms
6,820 KB |
testcase_12 | AC | 2,682 ms
6,816 KB |
testcase_13 | AC | 2,634 ms
6,820 KB |
testcase_14 | AC | 2,649 ms
6,820 KB |
testcase_15 | AC | 2,707 ms
6,820 KB |
testcase_16 | AC | 1 ms
6,816 KB |
testcase_17 | AC | 1 ms
6,820 KB |
testcase_18 | AC | 1 ms
6,820 KB |
testcase_19 | AC | 1 ms
6,816 KB |
testcase_20 | AC | 1 ms
6,820 KB |
testcase_21 | AC | 135 ms
6,816 KB |
testcase_22 | AC | 136 ms
6,816 KB |
testcase_23 | AC | 133 ms
6,820 KB |
testcase_24 | AC | 135 ms
6,816 KB |
testcase_25 | AC | 137 ms
6,820 KB |
コンパイルメッセージ
main.c:1:8: warning: multi-character character constant [-Wmultichar] 1 | char s['~~']; | ^~~~ main.c:2:12: warning: multi-character character constant [-Wmultichar] 2 | long dp[2]['~~'];mod=1e9+7,M,zero; | ^~~~ main.c:2:18: warning: data definition has no type or storage class 2 | long dp[2]['~~'];mod=1e9+7,M,zero; | ^~~ main.c:2:18: warning: type defaults to ‘int’ in declaration of ‘mod’ [-Wimplicit-int] main.c:2:28: warning: type defaults to ‘int’ in declaration of ‘M’ [-Wimplicit-int] 2 | long dp[2]['~~'];mod=1e9+7,M,zero; | ^ main.c:2:30: warning: type defaults to ‘int’ in declaration of ‘zero’ [-Wimplicit-int] 2 | long dp[2]['~~'];mod=1e9+7,M,zero; | ^~~~ main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | main(i,j){ | ^~~~ main.c: In function ‘main’: main.c:3:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:3:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c:4:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 4 | scanf("%s%d",s,&M); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | char s['~~']; main.c:4:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 4 | scanf("%s%d",s,&M); | ^~~~~ main.c:4:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:13:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 13 | M=!printf("%d",(dp[i&1][0]+zero)%mod); | ^~~~~~ main.c:13:12: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’ main.c:13:12: warning: incompatible implicit declaration o
ソースコード
char s['~~']; long dp[2]['~~'];mod=1e9+7,M,zero; main(i,j){ scanf("%s%d",s,&M); for(i=0;s[i];i++){ for(j=0;j<M;j++)dp[~i&1][j]=dp[i&1][j]; for(j=0;j<M;j++){ dp[~i&1][(10*j+s[i]-48)%M]+=dp[i&1][j]; dp[~i&1][j]%=mod;//高々mod*3 } (s[i]-=48)?dp[~i&1][s[i]%M]++:zero++; } M=!printf("%d",(dp[i&1][0]+zero)%mod); }