結果
問題 | No.635 自然門松列 |
ユーザー | ei1333333 |
提出日時 | 2018-01-19 23:08:55 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,567 bytes |
コンパイル時間 | 2,061 ms |
コンパイル使用メモリ | 204,560 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-06 19:26:31 |
合計ジャッジ時間 | 2,931 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | WA | - |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
ソースコード
#include <bits/stdc++.h> using namespace std; using int64 = long long; const int64 INF = 1LL << 62; int main() { int N; cin >> N; while(N--) { double x[3], y[3]; cin >> x[0] >> x[1] >> x[2]; cin >> y[0] >> y[1] >> y[2]; if(x[0] != x[2] || y[0] != y[2]) { bool flag = false; flag |= y[2] < y[1] && y[0] < y[1] && x[1] <= x[2] && x[0] * (y[1] - y[2]) <= x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] < y[1] && y[0] < y[1] && x[1] <= x[2] && x[0] * (y[1] - y[2]) > x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] < y[1] && y[0] < y[1] && x[1] > x[2] && x[0] >= x[1]; flag |= y[2] < y[1] && y[0] == y[1] && x[1] <= x[2] && x[0] < x[1]; flag |= y[2] < y[1] && y[0] == y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[2] < y[1] && y[0] > y[1] && x[1] <= x[2] && x[0] * (y[1] - y[2]) < x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] < y[1] && y[0] > y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[1] == y[2] && y[0] < y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[1] == y[2] && y[0] < y[1] && x[1] > x[2] && x[0] >= x[1]; flag |= y[1] == y[2] && y[0] == y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[1] == y[2] && y[0] > y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[2] > y[1] && y[0] < y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[2] > y[1] && y[0] < y[1] && x[1] > x[2] && x[1] <= x[0] && x[0] * (y[2] - y[1]) < -x[1] * y[0] + x[2] * y[0] - x[2] * y[1] + x[1] * y[2]; flag |= y[2] > y[1] && y[0] == y[1] && x[1] > x[2] && x[0] < x[1]; flag |= y[2] > y[1] && y[0] > y[1] && x[1] > x[2] && x[0] * (y[1] - y[2]) <= x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] > y[1] && y[0] > y[1] && x[1] > x[2] && -x[1] * y[0] + x[2] * y[0] - x[2] * y[1] + x[1] * y[2] < x[0] * (y[2] - y[1]) && x[0] < x[1]; if(flag) { puts("YES"); continue; } flag |= y[2] < y[1] && y[0] < y[1] && x[1] < x[2] && x[1] < x[0] && x[0] * (y[2] - y[1]) < -x[1] * y[0] + x[2] * y[0] - x[2] * y[1] + x[1] * y[2]; flag |= y[2] < y[1] && y[0] < y[1] && x[1] < x[2] && x[0] * (y[1] - y[2]) >= x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] < y[1] && y[0] == y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[2] < y[1] && y[0] > y[1] && x[1] < x[2] && -x[1] * y[0] + x[2] * y[0] - x[2] * y[1] + x[1] * y[2] < x[0] * (y[2] - y[1]) && x[0] <= x[1]; flag |= y[2] < y[1] && y[0] > y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[1] == y[2] && y[0] < y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[1] == y[2] && y[0] == y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[1] == y[2] && y[0] > y[1] && x[1] < x[2] && x[0] <= x[1]; flag |= y[1] == y[2] && y[0] > y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[2] > y[1] && y[0] < y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[2] > y[1] && y[0] < y[1] && x[1] >= x[2] && x[0] * (y[1] - y[2]) > x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] > y[1] && y[0] == y[1] && x[1] < x[2] && x[0] > x[1]; flag |= y[2] > y[1] && y[0] == y[1] && x[1] >= x[2] && x[0] > x[1]; flag |= y[2] > y[1] && y[0] > y[1] && x[1] < x[2] && x[0] <= x[1]; flag |= y[2] > y[1] && y[0] > y[1] && x[1] >= x[2] && x[0] * (y[1] - y[2]) < x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); flag |= y[2] > y[1] && y[0] > y[1] && x[1] >= x[2] && x[0] * (y[1] - y[2]) >= x[2] * (y[1] - y[0]) + x[1] * (y[0] - y[2]); if(flag) { puts("YES"); continue; } } puts("NO"); } }