結果
| 問題 | 
                            No.2173 Nightcord
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2022-12-25 02:11:59 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 716 bytes | 
| コンパイル時間 | 659 ms | 
| コンパイル使用メモリ | 82,592 KB | 
| 実行使用メモリ | 80,836 KB | 
| 最終ジャッジ日時 | 2024-11-18 09:29:04 | 
| 合計ジャッジ時間 | 18,008 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 RE * 1 | 
| other | AC * 26 RE * 28 | 
ソースコード
import sys,random,bisect
from collections import deque,defaultdict,Counter
from heapq import heapify,heappop,heappush
from itertools import cycle, permutations
from math import log,gcd
input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())
N,K = mi()
assert K == 3
star = [[] for p in range(2)]
for _ in range(N):
    x,y,c = mi()
    star[c-1].append((x,y))
for p in range(2):
    for x,y in star[p]:
        S = set()
        for xx,yy in star[p^1]:
            xx,yy = xx-x,yy-y
            g = gcd(xx,yy)
            xx,yy = xx//g,yy//g
            if (-xx,-yy) in S:
                exit(print("Yes"))
            S.add((xx,yy))
print("No")