結果
問題 |
No.1362 [Zelkova 8th Tune] Black Sheep
|
ユーザー |
👑 ![]() |
提出日時 | 2020-09-07 23:21:06 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 600 bytes |
コンパイル時間 | 163 ms |
コンパイル使用メモリ | 82,324 KB |
実行使用メモリ | 85,160 KB |
最終ジャッジ日時 | 2024-07-23 18:22:04 |
合計ジャッジ時間 | 3,671 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 RE * 20 |
ソースコード
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)