結果

問題 No.2905 Nabeatsu Integration
ユーザー 👑 獅子座じゃない人
提出日時 2024-08-21 23:25:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 409 bytes
コンパイル時間 3,191 ms
コンパイル使用メモリ 179,220 KB
実行使用メモリ 12,320 KB
最終ジャッジ日時 2024-09-07 11:33:51
合計ジャッジ時間 6,983 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 70
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

#include <atcoder/all>
using namespace atcoder;
using mint=modint998244353;

int main(void) {
    string s;
    cin >> s;
    int n=s.size();
    auto z=z_algorithm(s);
    mint ans=1-n;
    mint p=10;
    for(int i=1;i<=n;++i){
        if(z[n-i]==i){
            ans+=p;
        }
        p*=10;
    }
    cout << ans.val() << endl;
    return 0;
}
0