結果

問題 No.2778 Is there Same letter?
ユーザー YU Hirose
提出日時 2024-07-22 21:29:18
言語 JavaScript
(node v23.5.0)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 521 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 39,424 KB
最終ジャッジ日時 2024-07-22 21:29:22
合計ジャッジ時間 2,747 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main(input) {
    input = input.trim().split("\n");
    input.shift();
    const s = input[0].trim();
    let d = {};
    for (let i = 0; i < s.length; ++i) {
        let key = s[i];
        if (!d[key])
            d[key] = {ch: key, count:1};
        else
            d[key].count++;
    }
    for (let x of Object.values(d)) {
        if (x.count >= 2) {
            console.log("Yes");
            return false;
        }
    }
    console.log("No");
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
0