結果

問題 No.635 自然門松列
ユーザー pekempeypekempey
提出日時 2018-01-19 21:38:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 69,888 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 12:28:23
合計ジャッジ時間 1,858 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

bool is_kadomatsu(int x, int y, int z) {
  return x != y && x != z && y != z && (x < y && y > z || x > y && y < z);
}

int main() {
  int T;
  cin >> T;


  while (T--) {
    int x[3];
    int y[3];

    for (int i = 0; i < 3; i++) cin >> x[i], x[i] *= 11;
    for (int i = 0; i < 3; i++) cin >> y[i];

    bool ok = false;
    for (int ii = 0; ii < 20000; ii++) {
      ok |= is_kadomatsu(x[0], x[1], x[2]);
      x[0] += y[0];
      x[1] += y[1];
      x[2] += y[2];
    }
    puts(ok ? "YES" : "NO");
  }
}
0