結果

問題 No.2778 Is there Same letter?
ユーザー lingfunny
提出日時 2024-06-21 19:25:16
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 528 bytes
コンパイル時間 3,074 ms
コンパイル使用メモリ 242,260 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-21 19:25:21
合計ジャッジ時間 4,206 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

// Problem: No.2778 Is there Same letter?
// Group: yukicoder
// URL: https://yukicoder.me/problems/no/2778
// Memory Limit: 512 MB
// Time Limit: 2000 ms
// Author: lingfunny
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
using namespace std;

const int mxn =  100;

int cnt[mxn], n;
char s[mxn];

int main() {
	scanf("%d%s", &n, s + 1);
	for (int i = 1; i <= n; ++i)
		++cnt[s[i] - 'A'];
	for (int i = 0; i < 26; ++i)
		if (cnt[i] > 1) {
			puts("Yes");
			return 0;
		}
	puts("No");
	return 0;
}
0