結果
問題 | No.1362 [Zelkova 8th Tune] Black Sheep |
ユーザー |
👑 ![]() |
提出日時 | 2020-12-05 19:08:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 749 ms / 1,000 ms |
コード長 | 349 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 81,868 KB |
実行使用メモリ | 77,616 KB |
最終ジャッジ日時 | 2024-09-15 20:55:04 |
合計ジャッジ時間 | 30,653 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 38 |
ソースコード
#別解5from random import randintfrom collections import defaultdictfrom time import timeimport sysinput=sys.stdin.readlineS=input()[:-1]X=0N=len(S)D=defaultdict(int)BEGIN=time()while time()-BEGIN<0.70:i=randint(0,N-1)D[S[i]]+=1X+=1alpha=min(D,key=lambda x:D[x])print(S.index(alpha)+1,alpha)print(X,file=sys.stderr)