結果

問題 No.3155 Same Birthday
ユーザー is57primenumber
提出日時 2025-05-23 20:02:39
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 13,298 ms
コンパイル使用メモリ 382,484 KB
実行使用メモリ 13,240 KB
最終ジャッジ日時 2025-05-23 20:03:12
合計ジャッジ時間 16,909 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::collections::HashSet;

use proconio::input;

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

    let mut set = HashSet::new();

    for i in 0..n {
        let (ai, bi) = ab[i];
        if set.contains(&(ai, bi)) {
            println!("Yes");
            return;
        }
        set.insert((ai, bi));
    }

    println!("No");
}
0