結果

問題 No.2778 Is there Same letter?
コンテスト
ユーザー lingfunny
提出日時 2024-06-21 19:25:16
言語 C++23
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 314µs
コード長 528 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,040 ms
コンパイル使用メモリ 328,612 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-26 14:45:21
合計ジャッジ時間 3,106 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

// 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