結果
| 問題 | No.1407 Kindness |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-26 21:31:12 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 1,088 ms |
| コンパイル使用メモリ | 29,696 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 14:02:01 |
| 合計ジャッジ時間 | 2,122 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 36 |
コンパイルメッセージ
main.c:4:11: warning: built-in function 'pow' declared as non-function [-Wbuiltin-declaration-mismatch]
4 | long long pow[100001];
| ^~~
ソースコード
#include <stdio.h>
const int Mod = 1000000007;
long long pow[100001];
long long recursion(int l, char N[])
{
if (N[0] == 0 || N[0] == '0') return 0;
else return (recursion(l - 1, &(N[1])) * (N[0] - '0' - 1) + pow[l-1] * (N[0] - '0') * (N[0] - '0' + 1) / 2) % Mod;
}
int main()
{
char N[100001];
scanf("%s", N);
int i, l;
for (i = 1, pow[0] = 1; i <= 100000; i++) pow[i] = pow[i-1] * 45 % Mod;
for (l = 0; N[l] != 0; l++);
printf("%lld\n", recursion(l, N));
fflush(stdout);
return 0;
}