結果

問題 No.1362 [Zelkova 8th Tune] Black Sheep
ユーザー 👑 Kazun
提出日時 2020-12-05 19:06:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 754 ms / 1,000 ms
コード長 319 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 77,824 KB
最終ジャッジ日時 2024-09-15 20:49:10
合計ジャッジ時間 30,775 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#別解5
from random import randint
from collections import defaultdict
from time import time
import sys

S=input()

X=0
N=len(S)
D=defaultdict(int)
BEGIN=time()

while time()-BEGIN<0.70:
    i=randint(0,N-1)
    D[S[i]]+=1
    X+=1

alpha=min(D,key=lambda x:D[x])
print(S.index(alpha)+1,alpha)
print(X,file=sys.stderr)
0