提出 #29453530


ソースコード 拡げる

x1,y1,x2,y2 = map(int,input().split())


cf1 = [] 
x = x1 - 4
for i in range(7):
    x += 1
    y = y1 - 4
    for j in range(7):
        y += 1
        if  ((x-x1)**2 + (y-y1)**2) == 5:
            cf1.append([x,y])

cf2 = [] 
x = x2 - 4
for i in range(7):
    x += 1
    y = y2 - 4
    for j in range(7):
        y += 1
        if  ((x-x2)**2 + (y-y2)**2) == 5:
            cf2.append([x,y])
ans = 0
for i in cf1:
    for j in cf2:
        if i == j:
            print("Yes")
            ans += 1
            break
    if ans == 1:
        break

if ans == 0:
    print("No")

提出情報

提出日時
問題 C - Knight Fork
ユーザ Sirocco110
言語 Python (3.8.2)
得点 300
コード長 577 Byte
結果 AC
実行時間 22 ms
メモリ 9236 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 20
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 02_min_00.txt, 03_yes_00.txt, 03_yes_01.txt, 03_yes_02.txt, 03_yes_03.txt, 03_yes_04.txt, 03_yes_05.txt, 03_yes_06.txt, 03_yes_07.txt, 04_near_00.txt, 04_near_01.txt, 04_near_02.txt, 04_near_03.txt, 04_near_04.txt, 04_near_05.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 19 ms 9116 KiB
00_sample_01.txt AC 18 ms 8944 KiB
00_sample_02.txt AC 18 ms 9104 KiB
01_random_00.txt AC 18 ms 9100 KiB
01_random_01.txt AC 18 ms 9052 KiB
02_min_00.txt AC 19 ms 8952 KiB
03_yes_00.txt AC 18 ms 8948 KiB
03_yes_01.txt AC 18 ms 8952 KiB
03_yes_02.txt AC 21 ms 9048 KiB
03_yes_03.txt AC 17 ms 8948 KiB
03_yes_04.txt AC 18 ms 9172 KiB
03_yes_05.txt AC 20 ms 9048 KiB
03_yes_06.txt AC 18 ms 9104 KiB
03_yes_07.txt AC 21 ms 9100 KiB
04_near_00.txt AC 20 ms 9104 KiB
04_near_01.txt AC 17 ms 8952 KiB
04_near_02.txt AC 17 ms 9108 KiB
04_near_03.txt AC 19 ms 9236 KiB
04_near_04.txt AC 18 ms 9056 KiB
04_near_05.txt AC 22 ms 9104 KiB