結果

問題 No.2628 Shrinkage
ユーザー daiota
提出日時 2024-02-17 00:29:29
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 729 bytes
コンパイル時間 1,550 ms
コンパイル使用メモリ 168,224 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-09-28 23:15:49
合計ジャッジ時間 2,484 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)



int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	int i,j;

	int T;
	cin >> T;

	while(T--){

		ll x1,y1,x2,y2,X1,Y1,X2,Y2;
		cin >> x1 >> y1 >> x2 >> y2 >> X1 >> Y1 >> X2 >> Y2;

		if((y2-y1)*(X2-X1)!=(x2-x1)*(Y2-Y1) || (x2-x1)*(X2-X1)+(y2-y1)*(Y2-Y1)<0){
			cout << "No" << endl;
			continue;
		}


		if((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)<=(X1-X2)*(X1-X2)+(Y1-Y2)*(Y1-Y2)){
			if(x1==X1 && y1==Y1 && x2==X2 && y2==Y2){
				cout << "Yes" << endl;
				continue;
			}else{
				cout << "No" << endl;
				continue;
			}

		}


		cout << "Yes" << endl;


	}


	return 0;

}
0