結果
| 問題 |
No.2778 Is there Same letter?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-05-17 11:56:01 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 391 bytes |
| コンパイル時間 | 932 ms |
| コンパイル使用メモリ | 68,764 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-05-17 11:56:03 |
| 合計ジャッジ時間 | 1,761 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <iostream>
#include <string>
using namespace std;
int main() {
int N;
string S;
cin >> N >> S;
bool used[26] = {false}; // 26 chữ cái từ A-Z
for (char c : S) {
int idx = c - 'A';
if (used[idx]) {
cout << "Yes" << endl;
return 0;
}
used[idx] = true;
}
cout << "No" << endl;
return 0;
}