結果
| 問題 |
No.3061 Cut and Maximums
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 19:50:14 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,052 bytes |
| コンパイル時間 | 147 ms |
| コンパイル使用メモリ | 82,168 KB |
| 実行使用メモリ | 54,428 KB |
| 最終ジャッジ日時 | 2025-06-12 19:50:24 |
| 合計ジャッジ時間 | 3,368 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 33 |
ソースコード
S = input().strip()
n = len(S)
found = False
for start in range(n):
for end in range(start, n):
length = end - start + 1
if length % 2 != 0 or length < 2:
continue
valid = True
ev_letters = set()
for i in range(0, length, 2):
pos = start + i
if pos >= n or S[pos] == ' ':
valid = False
break
ev_letters.add(S[pos])
if not valid:
continue
R = set()
for i in range(1, length, 2):
pos = start + i
if pos >= n:
valid = False
break
if S[pos] != ' ':
R.add(S[pos])
if not valid:
continue
for i in range(n):
if i < start or i > end:
if S[i] != ' ':
R.add(S[i])
if ev_letters.isdisjoint(R):
found = True
break
if found:
break
print("Yes" if found else "No")
gew1fw