結果

問題 No.3644 Division by Shitoshitoto Sequence
コンテスト
ユーザー あるふぁ
提出日時 2026-08-29 14:25:00
言語 C++23(gcc16)
(gcc 16.1.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 34 ms / 2,000 ms
+ 889µs
コード長 1,853 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 5,561 ms
コンパイル使用メモリ 353,516 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-29 14:25:30
合計ジャッジ時間 8,758 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
サンプル 0 % AC * 1
小課題1 10 % AC * 3
小課題2 20 % AC * 2
小課題3 70 % AC * 21
合計 100 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define YUKICODER
// #define CODEFORCES

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pob pop_back
#define eb emplace_back
#define nall(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define accu accumulate
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define maxe max_element
#define mine min_element

#ifdef CODEFORCES
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define yesno(a) cout<<(a?"YES\n":"NO\n")
#define yesnoout(a, b) cout<<(a?"YES\n":"NO")<<(a?b:"")<<"\n"
#else
#define yes cout<<"Yes\n"
#define no cout<<"No\n"
#define yesno(a) cout<<(a?"Yes\n":"No\n")
#define yesnoout(a, b) cout<<(a?"Yes\n":"No")<<(a?b:"")<<"\n"
#endif

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;
template<class T> using vec = vector<T>;
template<class T> using vv = vector<vector<T>>;
template<class T> using vvv = vector<vv<T>>;

const int DX[] = {1, -1, 0, 0};
const int DY[] = {0, 0, 1, -1};
const pair<int, int> DXY[] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}};
const ll MOD = 998244353ll;
// const ll MOD = 1000000007ll;

void solve();
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    unsigned T = 1;
    cin >> T;
    cout << fixed << setprecision(20);
    while (T--) solve();
    return 0;
}

void solve(){
    int N;
    cin >> N;
    vector<int> A(5*N);
    for (int& x : A) cin >> x;

    bool ok = true;
    rep(i, N){
        auto b = vector(A.begin()+5*i, A.begin()+5*i+5);
        if (!(b[0] == b[2] && b[1] == b[3] && b[3] == b[4] && b[0] != b[1])){
            ok = false;
        }
    }
    yesno(ok);
}
0