結果

問題 No.3286 Make a Happy Connection
ユーザー ロロット
提出日時 2025-10-04 01:00:33
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 2,825 ms
コンパイル使用メモリ 278,320 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-04 01:00:49
合計ジャッジ時間 4,497 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ALL(a) (a).begin(), (a).end()
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector<int> A(N);
    for (auto& a : A)
        cin >> a;
    for (int i = 0; i < N - 2; i++) {
        if (A[i] == A[i + 1] || A[i] == A[i + 2]) {
            Yes;
            return 0;
        }
    }
    No;
}
0