結果

問題 No.1702 count good string
ユーザー harurunharurun
提出日時 2021-09-11 13:26:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 546 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 77,020 KB
最終ジャッジ日時 2023-09-30 09:29:52
合計ジャッジ時間 7,072 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
70,868 KB
testcase_01 AC 75 ms
70,512 KB
testcase_02 AC 75 ms
70,964 KB
testcase_03 AC 74 ms
70,764 KB
testcase_04 AC 74 ms
70,988 KB
testcase_05 AC 73 ms
70,832 KB
testcase_06 AC 75 ms
70,828 KB
testcase_07 AC 74 ms
70,908 KB
testcase_08 AC 75 ms
70,888 KB
testcase_09 AC 74 ms
70,864 KB
testcase_10 AC 75 ms
71,048 KB
testcase_11 AC 75 ms
70,604 KB
testcase_12 AC 75 ms
70,996 KB
testcase_13 AC 104 ms
76,968 KB
testcase_14 AC 106 ms
76,728 KB
testcase_15 AC 101 ms
76,684 KB
testcase_16 AC 102 ms
76,688 KB
testcase_17 AC 101 ms
76,628 KB
testcase_18 AC 102 ms
76,688 KB
testcase_19 AC 105 ms
76,796 KB
testcase_20 AC 103 ms
76,568 KB
testcase_21 AC 103 ms
77,020 KB
testcase_22 AC 102 ms
76,768 KB
testcase_23 AC 78 ms
70,912 KB
testcase_24 AC 77 ms
70,764 KB
testcase_25 AC 75 ms
70,928 KB
testcase_26 AC 76 ms
70,832 KB
testcase_27 AC 75 ms
71,004 KB
testcase_28 AC 76 ms
70,912 KB
testcase_29 AC 75 ms
70,916 KB
testcase_30 AC 75 ms
70,728 KB
testcase_31 AC 76 ms
70,772 KB
testcase_32 AC 76 ms
70,904 KB
testcase_33 AC 94 ms
76,000 KB
testcase_34 AC 95 ms
76,172 KB
testcase_35 AC 97 ms
76,188 KB
testcase_36 AC 96 ms
76,104 KB
testcase_37 AC 96 ms
76,104 KB
testcase_38 AC 96 ms
76,244 KB
testcase_39 AC 97 ms
76,044 KB
testcase_40 AC 95 ms
75,996 KB
testcase_41 AC 94 ms
75,952 KB
testcase_42 AC 96 ms
76,004 KB
testcase_43 AC 91 ms
75,676 KB
testcase_44 AC 99 ms
76,096 KB
testcase_45 AC 74 ms
70,960 KB
testcase_46 AC 73 ms
70,916 KB
testcase_47 AC 75 ms
70,916 KB
testcase_48 AC 75 ms
70,852 KB
testcase_49 AC 74 ms
71,004 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N=int(input())
  S=input()
  dp=[[0]*2 for __ in range(10)]
  T=set("yukicoder")
  d={"y":0,"u":1,"k":2,"i":3,"c":4,"o":5,"d":6,"e":7,"r":8}
  mod=10**9+7
  for i in range(N):
    if S[i] in T:
      if S[i]=="y":
        dp[0][0]+=1
      else:
        x=d[S[i]]
        dp[x][0]+=dp[x-1][0]
        dp[x][0]%=mod
        dp[x][1]+=dp[x-1][1]
        dp[x][1]%=mod
    elif S[i]=="?":
      dp[0][1]+=1
      for j in range(8):
        dp[j+1][1]+=dp[j][0]
        dp[j+1][1]%=mod
  print((dp[8][0]+dp[8][1])%mod)
  return

main()
0