結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー anagohirameanagohirame
提出日時 2020-04-01 23:17:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 452 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 8,512 KB
最終ジャッジ日時 2023-09-09 20:07:47
合計ジャッジ時間 1,889 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,284 KB
testcase_01 AC 18 ms
8,488 KB
testcase_02 AC 18 ms
8,372 KB
testcase_03 AC 19 ms
8,416 KB
testcase_04 AC 19 ms
8,412 KB
testcase_05 AC 18 ms
8,396 KB
testcase_06 AC 18 ms
8,360 KB
testcase_07 AC 19 ms
8,328 KB
testcase_08 AC 19 ms
8,396 KB
testcase_09 AC 19 ms
8,416 KB
testcase_10 AC 19 ms
8,436 KB
testcase_11 AC 19 ms
8,504 KB
testcase_12 AC 18 ms
8,484 KB
testcase_13 RE -
testcase_14 AC 19 ms
8,484 KB
testcase_15 RE -
testcase_16 AC 18 ms
8,392 KB
testcase_17 AC 19 ms
8,424 KB
testcase_18 AC 18 ms
8,512 KB
testcase_19 AC 19 ms
8,356 KB
testcase_20 AC 18 ms
8,408 KB
testcase_21 AC 18 ms
8,444 KB
testcase_22 AC 19 ms
8,368 KB
testcase_23 AC 19 ms
8,356 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import defaultdict
try:
	s = input()
except NameError:
	print("NO")
	sys.exit()
n = len(s)
if n < 2:
	print("NO")
	sys.exit()
d = defaultdict(list)
for i in range(n):
	if s[i] != " ":
		d[s[i]].append(i)
ok = False
if len(d) == 0:
	print("NO")
	sys.exit()
for v in d.values():
	l = len(v)
	tmp = True
	for i in range(l-1):
		if v[i+1] - v[i] != 2:
			tmp = False
	if tmp:
		ok = True
if ok:
	print("Yes")
else:
	print("NO")
0