結果

問題 No.2778 Is there Same letter?
ユーザー Today03
提出日時 2024-06-08 00:18:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 404 bytes
コンパイル時間 1,946 ms
コンパイル使用メモリ 195,536 KB
最終ジャッジ日時 2025-02-21 20:40:25
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;

int main() {
    int N;
    string S;
    cin >> N >> S;

    vector<int> cnt(26, 0);
    for (char c : S) {
        cnt[c - 'A']++;
    }

    for (int x : cnt) {
        if (x >= 2) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
}
0