提出 #53841688


ソースコード 拡げる

#!/usr/bin/env python3


def main():
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    A.sort()
    B.sort()

    C = A + B
    C.sort()

    ans = "No"

    for i in range(N + M - 1):
        if A.count(C[i]) >= 1 and A.count(C[i + 1]):
            ans = "Yes"
    
    print(ans)



if __name__ == '__main__':
    main()

提出情報

提出日時
問題 B - Piano 2
ユーザ rutent
言語 Python (PyPy 3.10-v7.3.12)
得点 200
コード長 419 Byte
結果 AC
実行時間 55 ms
メモリ 76648 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 20
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 55 ms 76440 KiB
00_sample_02.txt AC 55 ms 76300 KiB
00_sample_03.txt AC 55 ms 76200 KiB
01_random_01.txt AC 55 ms 76396 KiB
01_random_02.txt AC 55 ms 76348 KiB
01_random_03.txt AC 55 ms 76504 KiB
01_random_04.txt AC 54 ms 76364 KiB
01_random_05.txt AC 55 ms 76636 KiB
01_random_06.txt AC 54 ms 76304 KiB
01_random_07.txt AC 55 ms 76484 KiB
01_random_08.txt AC 55 ms 76280 KiB
01_random_09.txt AC 55 ms 76404 KiB
01_random_10.txt AC 55 ms 76456 KiB
02_handmade_01.txt AC 55 ms 76432 KiB
02_handmade_02.txt AC 55 ms 76380 KiB
02_handmade_03.txt AC 55 ms 76384 KiB
02_handmade_04.txt AC 55 ms 76648 KiB
02_handmade_05.txt AC 55 ms 76156 KiB
02_handmade_06.txt AC 54 ms 76316 KiB
02_handmade_07.txt AC 55 ms 76432 KiB