結果

問題 No.1909 Detect from Substrings
ユーザー Moss_LocalMoss_Local
提出日時 2022-04-22 21:17:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 13,444 KB
最終ジャッジ日時 2023-09-06 07:32:43
合計ジャッジ時間 3,664 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
11,180 KB
testcase_01 AC 41 ms
11,312 KB
testcase_02 AC 41 ms
11,324 KB
testcase_03 AC 43 ms
11,144 KB
testcase_04 AC 42 ms
11,200 KB
testcase_05 AC 41 ms
11,140 KB
testcase_06 AC 41 ms
11,256 KB
testcase_07 AC 41 ms
11,380 KB
testcase_08 AC 45 ms
13,208 KB
testcase_09 AC 45 ms
13,156 KB
testcase_10 AC 42 ms
11,148 KB
testcase_11 AC 43 ms
11,384 KB
testcase_12 AC 40 ms
11,328 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 #

from collections import defaultdict
from functools import lru_cache
from sys import flags, stdin
import math
import re
import queue
import typing
import itertools
import bisect
import statistics
# import numpy as np
# from numpy.core.function_base import _needs_add_docstring
# from numpy.core.numeric import outer
input = stdin.readline
MOD = 1000000007
INF = 122337203685477580


def solve():
    n, m = map(int, input().split())
    if n > 2:
        print(0)
        return
    a = input()
    b = input()
    # print(a[1:-1])
    # print(b[:-2])
    if a[1:-1] == b[:-2] and b[1:-1] == a[:-2]:
        print(2)
    elif a[1:-1] == b[:-2] or b[1:-1] == a[:-2]:
        print(1)
    else:
        print(0)

    return


if __name__ == '__main__':
    solve()
0