結果

問題 No.1620 Substring Sum
コンテスト
ユーザー nok0
提出日時 2021-05-29 13:00:50
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 429 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 182 ms
コンパイル使用メモリ 38,588 KB
最終ジャッジ日時 2026-02-22 07:17:38
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 4 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>

const int mod = 1000000007;
int n, res;
long long rui2[200010], rui11[200010];
char s[200010];
int main() {
	rui2[0] = rui11[0] = 1;
	for(int i = 0; i < 200000; i++)
		rui2[i + 1] = rui2[i] * 2 % mod, rui11[i + 1] = rui11[i] * 11 % mod;
	scanf("%s", s);
	n = strlen(s);
	for(int i = 0; i < n; i++) 
		res = (res + rui2[i] * rui11[n - 1 - i] * (s[i] - '0')) % mod;
	printf("%lld\n", res);
}
0