結果

問題 No.1620 Substring Sum
ユーザー kotatsugamekotatsugame
提出日時 2021-08-09 23:33:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 346 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 67,316 KB
実行使用メモリ 5,896 KB
最終ジャッジ日時 2023-10-21 21:49:32
合計ジャッジ時間 2,438 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,764 KB
testcase_01 AC 2 ms
5,764 KB
testcase_02 AC 3 ms
5,764 KB
testcase_03 AC 2 ms
5,764 KB
testcase_04 AC 7 ms
5,892 KB
testcase_05 AC 7 ms
5,892 KB
testcase_06 AC 7 ms
5,892 KB
testcase_07 AC 8 ms
5,892 KB
testcase_08 AC 7 ms
5,892 KB
testcase_09 AC 7 ms
5,892 KB
testcase_10 AC 7 ms
5,892 KB
testcase_11 AC 8 ms
5,892 KB
testcase_12 AC 4 ms
5,896 KB
testcase_13 AC 9 ms
5,892 KB
testcase_14 AC 8 ms
5,892 KB
testcase_15 AC 7 ms
5,892 KB
testcase_16 AC 6 ms
5,896 KB
testcase_17 AC 7 ms
5,892 KB
testcase_18 AC 3 ms
5,764 KB
testcase_19 AC 4 ms
5,764 KB
testcase_20 AC 9 ms
5,892 KB
testcase_21 AC 8 ms
5,892 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<atcoder/modint>
using namespace std;
using mint=atcoder::modint998244353;
string S;
mint p11[2<<17],p2[2<<17];
main()
{
	cin>>S;
	p11[0]=p2[0]=1;
	for(int i=1;i<S.size();i++)p11[i]=p11[i-1]*11,p2[i]=p2[i-1]*2;
	mint ans=0;
	for(int i=0;i<S.size();i++)ans+=(S[i]-'0')*p2[i]*p11[S.size()-i-1];
	cout<<ans.val()<<endl;
}
0