結果
問題 |
No.8119 間に合いませんでした><;
|
ユーザー |
👑 ![]() |
提出日時 | 2025-04-01 23:03:28 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,156 bytes |
コンパイル時間 | 693 ms |
コンパイル使用メモリ | 74,236 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-04-01 23:03:31 |
合計ジャッジ時間 | 2,601 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 14 WA * 10 TLE * 5 |
ソースコード
#ifdef NACHIA #define _GLIBCXX_DEBUG #else #define NDEBUG #endif #include <iostream> #include <string> #include <vector> #include <algorithm> using i64 = long long; using u64 = unsigned long long; #define rep(i,n) for(i64 i=0; i<i64(n); i++) const i64 INF = 1001001001001001001; template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; } template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; } using namespace std; i64 dp[15000] = {}; i64 P[70001] = {}; i64 Q[30000] = {}; void testcase(){ i64 N; cin >> N; string S; cin >> S; if(N%10 != 0){ cout << "0\n"; return; } dp[0] = 1; for(i64 i=0; i<N/5; i++) Q[i] = (S[i*5] == 'o' ? 0xffffffff : 0); for(i64 i=0; i<N/2; i++) P[i] = (S[i*2] == 'o' ? 0xffffffff : 0); rep(s,N/10+1) if(S[s*10] == 'o'){ dp[s] %= 998244353; i64 f = s * 10; i64 p = f * 5; i64 q = f * 2; i64 len = (N - f) / 10; for(i64 t=1; t<=len; t++){ dp[s+t] += dp[s] & Q[p+t] & S[q+t]; } } cout << dp[N/10] << "\n"; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); testcase(); return 0; }