結果
問題 | No.1909 Detect from Substrings |
ユーザー |
![]() |
提出日時 | 2022-04-22 21:17:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 762 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,152 KB |
最終ジャッジ日時 | 2024-06-24 02:18:08 |
合計ジャッジ時間 | 4,018 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 26 |
ソースコード
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()