結果
問題 | No.622 点と三角柱の内外判定 |
ユーザー |
![]() |
提出日時 | 2019-04-18 17:39:39 |
言語 | C++11 (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 851 bytes |
コンパイル時間 | 1,877 ms |
コンパイル使用メモリ | 162,836 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 09:20:50 |
合計ジャッジ時間 | 2,184 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 WA * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<(n);i++) #define pb push_back #define all(v) (v).begin(),(v).end() #define fi first #define se second typedef vector<int>vint; typedef pair<int,int>pint; typedef vector<pint>vpint; template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;} template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;} vector<int>uku(){ vint ret(3); rep(i,3)cin>>ret[i]; return ret; } double cross(vint A,vint B,vint C){ double ret=0; rep(i,3)ret+=(B[i]-A[i])*(C[i]-A[i]); return ret; } signed main(){ vint A,B,C,D; A=uku();B=uku();C=uku();D=uku(); int latte=0; if(cross(A,B,D)>0.0)latte++; if(cross(B,C,D)>0.0)latte++; if(cross(C,A,D)>0.0)latte++; if(latte==0||latte==3)cout<<"YES"<<endl; else cout<<"NO"<<endl; return 0; }