結果

問題 No.635 自然門松列
ユーザー treeonetreeone
提出日時 2018-01-19 23:17:10
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,198 bytes
コンパイル時間 1,323 ms
コンパイル使用メモリ 144,836 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-26 00:33:25
合計ジャッジ時間 2,470 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 8 ms
4,376 KB
testcase_12 AC 8 ms
4,376 KB
testcase_13 AC 7 ms
4,376 KB
testcase_14 AC 8 ms
4,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 7 ms
4,376 KB
testcase_18 AC 7 ms
4,376 KB
testcase_19 AC 7 ms
4,376 KB
testcase_20 AC 8 ms
4,384 KB
testcase_21 AC 7 ms
4,376 KB
testcase_22 AC 7 ms
4,380 KB
testcase_23 AC 7 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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;
            if(y[0] == 0 && y[2] == 0) break;
            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 && x[0] != 0 && x[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