結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー 👑 KazunKazun
提出日時 2020-09-07 23:21:06
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 600 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 89,420 KB
最終ジャッジ日時 2023-10-01 00:46:04
合計ジャッジ時間 8,009 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 148 ms
79,844 KB
testcase_01 AC 153 ms
79,980 KB
testcase_02 AC 148 ms
80,024 KB
testcase_03 AC 151 ms
79,772 KB
testcase_04 AC 148 ms
79,632 KB
testcase_05 AC 148 ms
80,108 KB
testcase_06 AC 148 ms
79,980 KB
testcase_07 AC 150 ms
80,020 KB
testcase_08 AC 147 ms
80,036 KB
testcase_09 AC 147 ms
79,940 KB
testcase_10 AC 150 ms
79,764 KB
testcase_11 AC 147 ms
79,972 KB
testcase_12 AC 145 ms
79,772 KB
testcase_13 RE -
testcase_14 RE -
testcase_15 AC 155 ms
81,460 KB
testcase_16 AC 177 ms
89,420 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 144 ms
79,632 KB
testcase_36 AC 145 ms
79,816 KB
testcase_37 AC 156 ms
79,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_letters
X=ascii_letters+"0123456789"

S=input()

#===制約チェック
assert 3<=len(S)<=2*10**5,"文字数違反(長さ:{})".format(len(S))
assert set(S)<=set(X),"構成文字違反(構成文字:{})".format(set(S))
assert len(set(S))==2,"文字の種類数違反(構成文字:{},種類数:{})".format(set(S),len(set(S)))

M=float("inf")
for s in set(S):
    M=min(M,S.count(s))
assert M==1,"Black Sheepになっていない(出現回数が少ない文字の出現回数:{})".format(M)
#===
[a,b]=list(set(S))

if S.count(a)==1:
    x=a
else:
    x=b

print(S.index(x)+1,x)
0