結果

問題 No.635 自然門松列
ユーザー treeone
提出日時 2018-01-19 22:59:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,153 bytes
コンパイル時間 1,528 ms
コンパイル使用メモリ 158,312 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 12:49:19
合計ジャッジ時間 2,559 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 15 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    rep(i, 0, n){
        int x[3], y[3];
        rep(j, 0, 3) cin >> x[j];
        rep(j, 0, 3) cin >> y[j];
        x[0] -= x[1];
        x[2] -= x[1];
        y[0] -= y[1];
        y[2] -= y[1];
        bool ans = false;
        rep(j, 0, 20010){
            if(x[0] * x[2] > 0) ans = true;
            int nx[3] = {};
            nx[0] = x[0] + y[0];
            nx[2] = x[2] + y[2];
            if(nx[0] * x[0] <= 0 && nx[2] * x[2] <= 0 && nx[0] != 0 && nx[2] != 0){
                if(x[0] * y[2] != x[2] * y[0]) ans = true;
            }
            x[0] = nx[0];
            x[2] = nx[2];
        }
        if(ans) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}
0