結果

問題 No.3286 Make a Happy Connection
コンテスト
ユーザー Tyto alba
提出日時 2025-11-23 23:43:53
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 74,308 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-11-23 23:43:56
合計ジャッジ時間 2,124 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 19 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void){
    int n, i, tp;
    vector<int> a;
    string ans = "No";
    
    cin >> n;
    a.clear();
    
    for (i=0; i<n; i++){
        cin >> tp;
        a.push_back(tp);
    }
    
    for (i=1; i<n; i++){
        if (a[i] == a[i-1] || i<1 && a[i] == a[i-2]) ans = "Yes";
    }
    
    cout << ans << endl;
    return 0;
}
0