{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbouzuya.hatenablog.com%2Fentry%2F2023%2F08%2F17%2F234437\" title=\"ABC307 E \u3092\u89e3\u3044\u305f - bouzuya.hatenablog.com\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","provider_url":"https://hatena.blog","image_url":null,"url":"https://bouzuya.hatenablog.com/entry/2023/08/17/234437","width":"100%","height":"190","version":"1.0","blog_title":"bouzuya.hatenablog.com","published":"2023-08-17 23:44:37","title":"ABC307 E \u3092\u89e3\u3044\u305f","author_url":"https://blog.hatena.ne.jp/bouzuya/","blog_url":"https://bouzuya.hatenablog.com/","categories":[],"type":"rich","provider_name":"Hatena Blog","author_name":"bouzuya","description":"\u6771\u4eac\u6d77\u4e0a\u65e5\u52d5\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30b9\u30c82023\uff08ABC307: AtCoder Beginner Contest 307\uff09 E - Distinct Adjacent https://atcoder.jp/contests/abc307/tasks/abc307_e \u63d0\u51fa: https://atcoder.jp/contests/abc307/submissions/44649944 O(NM) \u3092 O(N) \u306b\u3059\u308b\u305f\u3081\u306b DP \u306e\u72b6\u614b\u306e M \u500b\u306e\u6574\u6570\u306e\u90e8\u5206\u3092 \u4eba 1 \u306e\u6574\u6570\u304b\u305d\u308c\u4ee5\u5916\u304b\u306e 2 \u72b6\u614b\u306b\u3059\u308b \u89e3\u8aac\u3092\u805e\u304f\u3068\u3042\u3063\u3055\u308a\u89e3\u3051\u308b\u3082\u306e\u306e\u6c17\u4ed8\u3051\u306a\u304b\u3063\u305f use modint::ModInt998\u2026"}