結果

問題 No.635 自然門松列
ユーザー pekempeypekempey
提出日時 2018-01-19 21:38:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 695 ms
コンパイル使用メモリ 69,392 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-26 00:13:17
合計ジャッジ時間 2,438 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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