結果
問題 |
No.2628 Shrinkage
|
ユーザー |
|
提出日時 | 2024-02-16 21:57:41 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 709 bytes |
コンパイル時間 | 140 ms |
コンパイル使用メモリ | 82,540 KB |
実行使用メモリ | 57,368 KB |
最終ジャッジ日時 | 2024-09-28 20:13:50 |
合計ジャッジ時間 | 2,009 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 4 |
ソースコード
import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd def sol(): x1,y1,x2,y2,X1,Y1,X2,Y2 = map(int,input().split()) dx,dy = x1-x2, y1-y2 dX,dY = X1-X2, Y1-Y2 xyg = gcd(dx,dy) XYg = gcd(dX,dY) if (x1,y1) == (X1,Y1) and (x2,y2) == (X2,Y2): print('Yes') elif (x1,y1) == (X1,Y1) or (x2,y2) == (X2,Y2): print('No') elif (dx//xyg == dX//XYg and dy//xyg == dY//XYg) and abs(dx) > abs(dX): print('Yes') else: print('No') return T = int(input()) for i in range(T): sol()