結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー 👑 KazunKazun
提出日時 2020-11-10 23:35:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 264 ms / 1,000 ms
コード長 599 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 139,072 KB
最終ジャッジ日時 2023-10-01 00:46:37
合計ジャッジ時間 9,630 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
80,016 KB
testcase_01 AC 154 ms
80,028 KB
testcase_02 AC 151 ms
79,656 KB
testcase_03 AC 151 ms
79,848 KB
testcase_04 AC 152 ms
80,028 KB
testcase_05 AC 148 ms
79,904 KB
testcase_06 AC 148 ms
79,668 KB
testcase_07 AC 149 ms
80,028 KB
testcase_08 AC 151 ms
79,844 KB
testcase_09 AC 150 ms
80,036 KB
testcase_10 AC 150 ms
80,012 KB
testcase_11 AC 151 ms
79,936 KB
testcase_12 AC 151 ms
79,836 KB
testcase_13 AC 228 ms
116,348 KB
testcase_14 AC 211 ms
105,076 KB
testcase_15 AC 156 ms
81,364 KB
testcase_16 AC 183 ms
89,404 KB
testcase_17 AC 229 ms
116,016 KB
testcase_18 AC 184 ms
86,768 KB
testcase_19 AC 234 ms
115,892 KB
testcase_20 AC 196 ms
94,528 KB
testcase_21 AC 197 ms
95,200 KB
testcase_22 AC 215 ms
103,752 KB
testcase_23 AC 254 ms
139,060 KB
testcase_24 AC 263 ms
138,832 KB
testcase_25 AC 256 ms
139,012 KB
testcase_26 AC 252 ms
138,856 KB
testcase_27 AC 258 ms
139,072 KB
testcase_28 AC 263 ms
138,992 KB
testcase_29 AC 264 ms
138,992 KB
testcase_30 AC 261 ms
138,644 KB
testcase_31 AC 258 ms
138,972 KB
testcase_32 AC 261 ms
138,824 KB
testcase_33 AC 260 ms
138,872 KB
testcase_34 AC 264 ms
138,968 KB
testcase_35 AC 155 ms
79,952 KB
testcase_36 AC 156 ms
79,848 KB
testcase_37 AC 151 ms
79,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_letters
X=ascii_letters+"0123456789"

S=input()

#===制約チェック
assert 3<=len(S)<=5*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