結果
| 問題 | No.2772 Appearing Even Times | 
| コンテスト | |
| ユーザー |  FplusFplusF | 
| 提出日時 | 2024-05-31 23:14:45 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,398 bytes | 
| コンパイル時間 | 3,084 ms | 
| コンパイル使用メモリ | 248,728 KB | 
| 実行使用メモリ | 163,528 KB | 
| 最終ジャッジ日時 | 2024-12-21 01:31:52 | 
| 合計ジャッジ時間 | 21,394 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 RE * 1 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
using ld=long double;
const ll INF=(1ll<<60);
#define rep(i,n) for (ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(),v.end()
template<class T> inline bool chmin(T &a,T b){
    if(a>b){
        a=b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T &a,T b){
    if(a<b){
        a=b;
        return true;
    }
    return false;
}
#include<atcoder/modint>
using mint=atcoder::modint998244353;
mint dp[10001][2][2][1<<10];
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    ll n=(ll)s.size();
    dp[0][0][0][0]=1;
    rep(i,n){
        rep(j,1<<10){
            rep(k,10){
                rep(l,2){
                    ll x=l|(k!=0),y=j;
                    if(x==1) y^=1<<k;
                    if(k<s[i]-'0'){
                        dp[i+1][1][x][y]+=dp[i][0][l][j];
                        dp[i+1][1][x][y]+=dp[i][1][l][j];
                    }else if(k==s[i]-'0'){
                        dp[i+1][0][x][y]+=dp[i][0][l][j];
                        dp[i+1][1][x][y]+=dp[i][1][l][j];
                    }else{
                        dp[i+1][1][x][y]+=dp[i][1][l][j];
                    }
                }
            }
        }
    }
    cout << (dp[n][0][1][0]+dp[n][1][1][0]).val() << '\n';
}
            
            
            
        