結果

問題 No.3180 angles sum
ユーザー あいすあうと
提出日時 2025-06-13 22:32:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 377 ms / 2,000 ms
コード長 1,741 bytes
コンパイル時間 5,747 ms
コンパイル使用メモリ 335,184 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-14 01:43:10
合計ジャッジ時間 11,415 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template<typename T> using vc = vector<T>;
template<typename T> using vv = vc<vc<T>>;
using vl = vc<ll>;
using vvl = vc<vc<ll>>;
using vul = vc<ull>;
using vs = vc<string>;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define Rep(i,n) for(ll i=n-1;i>=0;i--)
//#define rep(i,n) for(ull i=0;i<(n);i++)
#define nall(x) x.begin(),x.end()
#define pb push_back
#define pob pop_back
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define YN {cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define M1 cout<<"-1"<<endl
const long long INF = (1LL<<62)-(1LL<<31)-1;
#define denl endl
#define edln endl
#define ednl endl
//vl dx = {1,-1,0,0};vl dy = {0,0,1,-1};
//vl dx={0,0,1,1,1,-1,-1,-1};vl dy={1,-1,0,1,-1,0,1,-1};
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	ll t;
	cin >> t;
	while(t--){
	  ll ax,ay,bx,by,cx,cy;
	  cin >> ax >> ay >> bx >> by >> cx >> cy;
	  
	  bool ok=false;
	  if(ax==0 && bx==0){
	    if(cy==0 && cx<0)ok=true;
	  }
	  else if(ax==0 || bx==0){
	    if(ax==0){
	      if(by==0){
	        if(cx==0 && cy>0)ok=true;
	      }
	      else if(cx<0 && by*cy==-bx*cx)ok=true;
	    }
	    else{
	      if(ay==0){
	        if(cx==0 && cy>0)ok=true;
	      }
	      else{
	        if(cx<0 && ay*cy==-ax*cx)ok=true;
	      }
	    }
	  }
	  else{
	    ll ab=ax*by+ay*bx, disab=ax*bx-ay*by;
	    if(disab==0){
	      if(cx==0 && cy>0)ok=true;
	    }
	    else if(disab>0){
	      if(cx>0 && cy*disab==cx*ab)ok=true;
	    }
	    else{
	      if(cx<0 && cy*disab==cx*ab)ok=true;
	    }
	  }
	  if(ok)YN;
	}
}
0