結果

問題 No.870 無敵囲い
ユーザー hal9009hal9009
提出日時 2020-11-19 21:01:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 8,004 KB
最終ジャッジ日時 2023-09-11 16:38:12
合計ジャッジ時間 1,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,816 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
7,888 KB
testcase_06 WA -
testcase_07 AC 16 ms
7,884 KB
testcase_08 AC 16 ms
7,848 KB
testcase_09 AC 16 ms
7,928 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 15 ms
7,816 KB
testcase_13 AC 16 ms
7,828 KB
testcase_14 AC 16 ms
7,744 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 16 ms
7,800 KB
testcase_20 AC 16 ms
7,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def isContain(goal,s):
    ans = 'NO'
    for v in goal:
        if v not in s:
            ans = 'NO'
    return ans

n = int(input())
xy1 = []
xy2 = []
goal = [[2, 8], [3, 9], [7, 9]]

for i in range(n):
    xi1, yi1, xi2, yi2 = map(int, input().split())
    xy1.append([xi1, yi1])
    xy2.append([xi2, yi2])

ans = 'NO'

s = [xy1[i] for i in range(n)]
s.sort()
ans = isContain(goal, s)

for i in range(n):
    s[s.index(xy1[i])] = xy2[i]
    s.sort()
    ans = isContain(goal, s)
    if ans == 'YES':
        break
print(ans)
0