結果

問題 No.1909 Detect from Substrings
ユーザー siganaisiganai
提出日時 2022-04-22 21:19:33
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 803 bytes
コンパイル時間 603 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 355,656 KB
最終ジャッジ日時 2023-09-06 07:35:39
合計ジャッジ時間 10,816 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
83,596 KB
testcase_01 AC 145 ms
78,428 KB
testcase_02 AC 147 ms
78,840 KB
testcase_03 AC 1,112 ms
86,116 KB
testcase_04 AC 1,077 ms
86,124 KB
testcase_05 AC 1,135 ms
86,756 KB
testcase_06 AC 1,062 ms
87,236 KB
testcase_07 AC 1,105 ms
86,728 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env PyPy3

from collections import Counter, defaultdict, deque
import itertools
import re
import math
from functools import reduce
import operator
import bisect
import heapq
import functools
mod=10**9+7

import sys
input=sys.stdin.readline

n,m=map(int,input().split())
s=[input().rstrip() for _ in range(n)]
ans = 0
for i in range(26):
    for j in range(m+1):
        tmp = []
        for k in range(j):
            tmp.append(s[0][k])
        tmp.append(chr(i+ord('a')))
        for k in range(j,m):
            tmp.append(s[0][k])
        for ii in range(1,n):
            now = 0
            for k in range(m+1):
                if now < m and tmp[k] == s[ii][now]:
                    now += 1
            if now != m:
                break
        else:
            ans += 1
print(ans)
0