結果
| 問題 |
No.635 自然門松列
|
| コンテスト | |
| ユーザー |
はまやんはまやん
|
| 提出日時 | 2018-01-20 00:37:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 2,425 bytes |
| コンパイル時間 | 1,860 ms |
| コンパイル使用メモリ | 175,572 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 12:57:45 |
| 合計ジャッジ時間 | 2,777 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 WA * 4 |
ソースコード
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
∧_∧
∧_∧ (´<_` ) Welcome to My Coding Space!
( ´_ゝ`) / ⌒i
/ \ | |
/ / ̄ ̄ ̄ ̄/ |
__(__ニつ/ _/ .| .|____
\/____/ (u ⊃
---------------------------------------------------------------------------------------------------*/
double x[3], y[3], xx[3];
//---------------------------------------------------------------------------------------------------
string solve() {
rep(i, 0, 3) cin >> x[i];
rep(i, 0, 3) cin >> y[i];
vector<double> v;
v.push_back(0);
rep(i, 0, 3) rep(j, 0, 3) if (i != j and x[i] < x[j] and y[i] > y[j]) {
double ng = 0, ok = 2020;
rep(k, 0, 100) {
double md = (ng + ok) / 2;
double xi = x[i] + y[i] * md;
double xj = x[j] + y[j] * md;
if (xi > xj) ok = md;
else ng = md;
}
v.push_back(ok);
}
set<double> w;
fore(t, v) {
w.insert(t - 0.01);
w.insert(t);
w.insert(t + 0.01);
}
fore(t, w) if(0 <= t) {
rep(i, 0, 3) xx[i] = x[i] + y[i] * t;
int ok = 0;
if (xx[0] < xx[1] and xx[2] < xx[1]) ok = 1;
if (xx[0] > xx[1] and xx[2] > xx[1]) ok = 1;
if (ok) return "YES";
}
return "NO";
}
//---------------------------------------------------------------------------------------------------
void _main() {
int N; cin >> N;
rep(i, 0, N) printf("%s\n", solve().c_str());
}
はまやんはまやん