結果

問題 No.2343 (l+r)/2
ユーザー LeoPro
提出日時 2023-06-09 21:03:40
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 732 bytes
コンパイル時間 2,045 ms
コンパイル使用メモリ 197,240 KB
最終ジャッジ日時 2025-02-13 23:39:39
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define int long long

using namespace std;
using ll = long long;

void solve();

template<typename ...Args>
void println(Args... args) {
    apply([](auto &&... args) { ((cout << args << ' '), ...); }, tuple(args...));
    cout << '\n';
}

int32_t main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int t = 1;
    cin >> t;
    for (int tc = 0; tc < t; ++tc) {
        solve();
    }
    return 0;
}

void solve() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int &x : a) cin >> x;
    if (a.front() != a.back()) return println("Yes");
    int x = a.front();
    for (int i = 0; i + 1 < n; ++i) if (a[i] != x && a[i + 1] != x) return println("Yes");
    println("No");
}
0