結果
| 問題 | 
                            No.2778 Is there Same letter?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-06-07 22:20:40 | 
| 言語 | C++23  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 293 bytes | 
| コンパイル時間 | 2,799 ms | 
| コンパイル使用メモリ | 93,860 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-26 08:28:47 | 
| 合計ジャッジ時間 | 1,556 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 12 | 
ソースコード
#include <iostream>
#include <unordered_set>
int main() {
    int n;
    std::string s;
    std::cin >> n >> s;
    std::unordered_set<char> t;
    bool ok = false;
    for(const auto &c: s) {
        ok |= t.contains(c);
        t.emplace(c);
    }
    std::cout << (ok ? "Yes\n" : "No\n");
}