結果
問題 |
No.622 点と三角柱の内外判定
|
ユーザー |
|
提出日時 | 2021-02-10 17:44:39 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 653 bytes |
コンパイル時間 | 1,810 ms |
コンパイル使用メモリ | 194,972 KB |
最終ジャッジ日時 | 2025-01-18 17:05:42 |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<(int)(n); i++) int main() { ios_base::sync_with_stdio(0); cin.tie(0); vector<double> x(5), y(5), z(5); for (int i = 0; i < 4; i++) cin >> x[i] >> y[i] >> z[i]; x[4] = (x[0] + x[1] + x[2]) / 3; y[4] = (y[0] + y[1] + y[2]) / 3; z[4] = (z[0] + z[1] + z[2]) / 3; bool ck = true; for (int i = 0; i < 3; i++) { double dot = (x[3] - x[i]) * (x[4] - x[i]) + (y[3] - y[i]) * (y[4] - y[i]) + (z[3] - z[i]) * (z[4] - z[i]); ck &= dot >= 0; } if (ck) cout << "YES" << endl; else cout << "NO" << endl; return 0; }