結果
問題 | No.2628 Shrinkage |
ユーザー |
|
提出日時 | 2024-02-16 22:05:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 890 bytes |
コンパイル時間 | 318 ms |
コンパイル使用メモリ | 82,628 KB |
実行使用メモリ | 57,120 KB |
最終ジャッジ日時 | 2024-09-28 20:22:39 |
合計ジャッジ時間 | 2,150 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 WA * 6 |
ソースコード
import syssys.setrecursionlimit(5*10**5)input = sys.stdin.readlinefrom collections import defaultdict, deque, Counterfrom heapq import heappop, heappushfrom bisect import bisect_left, bisect_rightfrom math import gcddef sol():x1,y1,x2,y2,X1,Y1,X2,Y2 = map(int,input().split())dx,dy = x1-x2, y1-y2dX,dY = X1-X2, Y1-Y2xyg = gcd(dx,dy)XYg = gcd(dX,dY)if (x1,y1) == (X1,Y1) and (x2,y2) == (X2,Y2):print('Yes')elif x1 == X1 == x2 == X2:if y1 <= Y1 < Y2 <= y2:print('Yes')else:print('No')elif y1 == Y1 == y2 == Y2:if x1 <= X1 < X2 <= x2:print('Yes')else:print('No')elif (dx//xyg == dX//XYg and dy//xyg == dY//XYg) and abs(dx) > abs(dX):print('Yes')else:print('No')returnT = int(input())for i in range(T):sol()