結果

問題 No.3286 Make a Happy Connection
ユーザー Haniwa
提出日時 2025-10-04 21:02:10
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 333 bytes
コンパイル時間 12,105 ms
コンパイル使用メモリ 401,412 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-04 21:02:24
合計ジャッジ時間 11,014 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
	input! {
		n: usize,
		a: [usize; n],
	}

    for i in 0..n-1 {
        if a[i] == a[i+1] {
            println!("Yes");
            return;
        }
    }


    for i in 0..n-2 {
        if a[i] == a[i+2] {
            println!("Yes");
            return;
        }
    }

    println!("No");	
}
0