結果
| 問題 | No.2778 Is there Same letter? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-06-07 21:41:34 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 28 ms / 2,000 ms |
| + 33µs | |
| コード長 | 648 bytes |
| 記録 | |
| コンパイル時間 | 67 ms |
| コンパイル使用メモリ | 81,388 KB |
| 実行使用メモリ | 57,644 KB |
| 最終ジャッジ日時 | 2026-10-08 05:16:58 |
| 合計ジャッジ時間 | 1,683 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
# N文字の文字列Sが与えられる
# 文字列Sに同じ文字が2個以上存在するかを判定せよ
#
# Nは整数
# Sは英大文字からなる文字列
# 2 <= N <= 26
# |S| == N
import sys
import itertools
import time
from math import radians, sin, cos, tan, sqrt
from collections import deque
def input():
return sys.stdin.readline().replace('\n','')
sys.setrecursionlimit(1000000)
md1 = 998244353
md2 = 10 ** 9 + 7
N = int(input())
S = input()
flag = False
for i in range(0, N):
for j in range(i+1, N):
if S[i] == S[j]:
flag = True
break
if flag:
print('Yes')
else:
print('No')