結果
問題 | No.2628 Shrinkage |
ユーザー |
|
提出日時 | 2024-02-16 23:49:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 687 bytes |
コンパイル時間 | 1,937 ms |
コンパイル使用メモリ | 168,268 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-28 23:00:48 |
合計ジャッジ時間 | 2,456 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define int long long#define pt pair<int,int>#define x first#define y secondint one=1;int dist(pt a,pt b){return (a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y);}int32_t main(){ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);int t;cin>>t;while(t--){pt a,b,c,d;cin>>a.x>>a.y;cin>>b.x>>b.y;cin>>c.x>>c.y;cin>>d.x>>d.y;if(a.x==c.x && a.y==c.y && b.x==d.x && b.y==d.y) {cout<<"Yes\n";continue;}if((a.x-b.x)*one*(c.y-d.y)==(a.y-b.y)*one*(c.x-d.x) && dist(a,b)>dist(c,d) && (a.x-b.x)*(c.x-d.x)+(a.y-b.y)*(c.y-d.y)>0) {cout<<"Yes\n";}else {cout<<"No\n";}}return 0;}