結果

問題 No.3644 Division by Shitoshitoto Sequence
コンテスト
ユーザー tnakao0123
提出日時 2026-08-26 13:34:16
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 44 ms / 2,000 ms
+ 180µs
コード長 741 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 199 ms
コンパイル使用メモリ 52,952 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-26 13:34:32
合計ジャッジ時間 3,591 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % AC * 1
小課題1 10 % AC * 3
小課題2 20 % AC * 2
小課題3 70 % AC * 21
合計 100 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* -*- coding: utf-8 -*-
 *
 * 3644.cc:  No.3644 Division by Shitoshitoto Sequence - yukicoder
 */

#include<cstdio>
#include<algorithm>

using namespace std;

/* constant */

const int MAX_N = 100000;
const int MAX_N5 = MAX_N * 5;

/* typedef */

/* global variables */

int as[MAX_N5];

/* subroutines */

bool stt(int xs[]) {
  return
    xs[0] == xs[2] && xs[1] == xs[3] && xs[1] == xs[4] && xs[0] != xs[1];
}

/* main */

int main() {
  int tn;
  scanf("%d", &tn);

  while (tn--) {
    int n;
    scanf("%d", &n);
    int n5 = n * 5;
    for (int i = 0; i < n5; i++) scanf("%d", as + i);

    bool ok = true;
    for (int i = 0; ok && i < n5; i += 5) ok = stt(as + i);

    if (ok) puts("Yes");
    else puts("No");
  }

  return 0;
}
0