結果
| 問題 |
No.2778 Is there Same letter?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-15 17:55:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 328 bytes |
| コンパイル時間 | 638 ms |
| コンパイル使用メモリ | 66,448 KB |
| 最終ジャッジ日時 | 2025-02-23 15:47:18 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
#include <iostream>
using namespace std;
int main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
int N, i, count[26] = { 0 };
char S[27];
cin >> N >> S;
for (i = 0; S[i] != '\0'; ++i)
{
++count[S[i] - 'A'];
if (count[S[i] - 'A'] >= 2)
{
cout << "Yes\n";
return 0;
}
}
cout << "No\n";
return 0;
}