結果
問題 | No.1702 count good string |
ユーザー | MasKoaTS |
提出日時 | 2021-10-31 17:56:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,191 bytes |
コンパイル時間 | 178 ms |
コンパイル使用メモリ | 82,228 KB |
実行使用メモリ | 159,488 KB |
最終ジャッジ日時 | 2024-10-09 05:39:33 |
合計ジャッジ時間 | 14,075 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 121 ms
86,516 KB |
testcase_01 | AC | 124 ms
86,624 KB |
testcase_02 | AC | 129 ms
88,832 KB |
testcase_03 | AC | 134 ms
89,088 KB |
testcase_04 | AC | 133 ms
89,536 KB |
testcase_05 | AC | 133 ms
89,344 KB |
testcase_06 | AC | 141 ms
89,344 KB |
testcase_07 | AC | 133 ms
89,728 KB |
testcase_08 | AC | 135 ms
88,832 KB |
testcase_09 | AC | 133 ms
89,472 KB |
testcase_10 | AC | 135 ms
89,208 KB |
testcase_11 | AC | 136 ms
89,088 KB |
testcase_12 | AC | 138 ms
89,192 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 138 ms
89,344 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 137 ms
89,344 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | AC | 358 ms
158,848 KB |
testcase_44 | AC | 365 ms
159,488 KB |
testcase_45 | AC | 122 ms
86,196 KB |
testcase_46 | AC | 123 ms
86,476 KB |
testcase_47 | AC | 122 ms
86,452 KB |
testcase_48 | AC | 122 ms
86,528 KB |
testcase_49 | AC | 122 ms
86,272 KB |
ソースコード
import itertools as iter import collections as coll import heapq as hq import bisect as bis from decimal import Decimal as dec from copy import deepcopy as dcopy import math import sys sys.setrecursionlimit(10**6) def input(): return sys.stdin.readline().rstrip() def getN(): return int(sys.stdin.readline().rstrip()) def getNs(): return map(int,sys.stdin.readline().rstrip().split()) def getList(): return list(map(int,sys.stdin.readline().rstrip().split())) def strinps(n): return [sys.stdin.readline().rstrip() for _ in range(n)] pi = 3.141592653589793 mod = 10**9+7 MOD = 998244353 INF = math.inf dx = [1,0,-1,0]; dy = [0,1,0,-1] """ Main Code """ n = getN() s = input() words = ["yukicoder","?ukicoder","y?kicoder","yu?icoder","yuk?coder","yuki?oder","yukic?der","yukico?er","yukicod?r","yukicode?"] def calc_dp(w): dp = [[0]*n for _ in range(9)] if(s[0] == w[0]): dp[0][0] = 1 for i in range(n): if(s[i] == w[0]): dp[0][i] = (dp[0][i-1]+1) % mod else: dp[0][i] = dp[0][i-1] for j in range(1,9): if(s[i] == w[j]): dp[j][i] = (dp[j][i-1]+dp[j-1][i-1]) % mod else: dp[j][i] = dp[j][i-1] return dp[8][n-1] print(sum(calc_dp(w) for w in words))