結果
| 問題 |
No.622 点と三角柱の内外判定
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-20 01:54:40 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 959 bytes |
| コンパイル時間 | 1,430 ms |
| コンパイル使用メモリ | 168,992 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-19 23:29:17 |
| 合計ジャッジ時間 | 2,319 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 WA * 7 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct point{
ll x, y, z;
point& operator -= (const point& rhs) {
x -= rhs.x, y -= rhs.y, z -= rhs.z;
return *this;
}
friend point operator - (const point& lhs, const point& rhs) {return point(lhs) -= rhs;}
friend istream& operator >> (istream& os, point& rhs) noexcept {
os >> rhs.x >> rhs.y >> rhs.z;
return os;
}
friend ll operator * (const point& lhs, const point& rhs) {
return lhs.x * rhs.x + lhs.y * rhs.y + lhs.z * rhs.z;
}
};
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
vector<point> a(4);
for(int i = 0; i < 4; i++) cin >> a[i];
for(int i = 0; i < 3; i++){
point p1 = a[3] - a[i], p2 = a[(i + 1) % 3] - a[i], p3 = a[(i + 2) % 3] - a[i];
if(!(0 <= p1 * p2 && 0 <= p1 * p3)){
cout << "NO\n";
exit(0);
}
}
cout << "YES\n";
}