結果
問題 |
No.3180 angles sum
|
ユーザー |
![]() |
提出日時 | 2025-06-13 22:45:22 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,287 bytes |
コンパイル時間 | 2,808 ms |
コンパイル使用メモリ | 278,548 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-14 01:43:31 |
合計ジャッジ時間 | 12,074 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 16 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; struct vec { ll x, y; vec(ll x_, ll y_) : x(x_), y(y_) {} vec() : x(0), y(0) {} vec operator-() { return vec(-x, -y); } vec operator+=(vec rhs) { x += rhs.x; y += rhs.y; return *this; } vec operator-=(vec rhs) { x -= rhs.x; y -= rhs.y; return *this; } vec operator*=(ll rhs) { x *= rhs; y *= rhs; return *this; } vec operator+(vec rhs) { return vec(*this) += rhs; } vec operator-(vec rhs) { return vec(*this) -= rhs; } vec operator*(ll rhs) { return vec(*this) *= rhs; } bool operator==(vec rhs) { return x == rhs.x && y == rhs.y; } bool operator!=(vec rhs) { return !(*this == rhs); } ll dot(vec rhs) const { return x * rhs.x + y * rhs.y; } ll cross(vec rhs) const { return x * rhs.y - y * rhs.x; } ll norm2() const { return x * x + y * y; }; double norm() const { return sqrt((*this).norm2()); }; void print() { cout << x << " " << y << endl; } }; int main() { int tt; cin >> tt; while (tt--) { vector<vec> p(3); for (int i = 0; i < 3; i++) { cin >> p[i].x >> p[i].y; } vec d(p[0].x * p[1].x - p[0].y * p[1].y, p[0].x * p[1].y + p[0].y * p[1].x); if (d.cross(p[2]) == 0) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }