結果
| 問題 | No.2055 12x34... |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-26 23:49:19 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 2,567 ms |
| コンパイル使用メモリ | 342,928 KB |
| 実行使用メモリ | 56,064 KB |
| 最終ジャッジ日時 | 2026-06-26 23:49:33 |
| 合計ジャッジ時間 | 8,695 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 36 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=998244353;
map<ll,ll> dp1,dp2;
set<ll> se;
void solve(){
dp1[0] = 0;
ll n;
cin >> n;
for(ll i=0;i<n;i++){
ll a;
cin >> a;
se.insert(a);
dp2[a] = dp1[a]+1;
dp1[a] = (dp1[a]+dp1[a-1]+dp2[a-1])%mod;
}
ll cnt = 0;
for(auto i:se){
cnt = (cnt+dp1[i])%mod;
}
cout << cnt;
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
solve();
}