結果

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

ソースコード

diff #

use proconio::input;

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

    if (0..n - 2).any(|i| a[i] == a[i + 1] || a[i] == a[i + 2] || a[i + 1] == a[i + 2]) {
        println!("Yes");
    } else {
        println!("No");
    }
}
0