結果

問題 No.1909 Detect from Substrings
ユーザー ygd.ygd.
提出日時 2022-04-22 22:46:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,050 bytes
コンパイル時間 486 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 75,964 KB
最終ジャッジ日時 2023-09-06 09:25:23
合計ジャッジ時間 5,220 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,372 KB
testcase_01 AC 72 ms
70,976 KB
testcase_02 AC 70 ms
71,480 KB
testcase_03 AC 70 ms
71,448 KB
testcase_04 AC 72 ms
71,408 KB
testcase_05 AC 78 ms
71,376 KB
testcase_06 AC 88 ms
75,456 KB
testcase_07 AC 86 ms
75,432 KB
testcase_08 AC 77 ms
75,916 KB
testcase_09 AC 78 ms
75,852 KB
testcase_10 AC 77 ms
73,180 KB
testcase_11 AC 78 ms
73,364 KB
testcase_12 AC 75 ms
71,280 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 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline
#input = sys.stdin.buffer.readline #文字列はダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]
#dx8 = [1,1,0,-1,-1,-1,0,1]
#dy8 = [0,1,1,1,0,-1,-1,-1]

def main():
    N,M = map(int,input().split())
    S = set([])
    for i in range(N):
        s = input()
        S.add(s)

    if len(S) == 1:
        S = list(S)
        S = set(S[0])
        #print(S)
        if len(S) == 1:
            print(51)
        else:
            print(52)
        exit()
    
    if len(S) >= 3:
        print(0);exit()
    
    S = list(S)
    a = S[0]
    b = S[1]
    ans = 0
    if a[1:] == b[:-1]:
        ans += 1
    if b[1:] == a[:-1]:
        ans += 1
    print(ans)
  
if __name__ == '__main__':
    main()
0