結果

問題 No.378 名声値を稼ごう
ユーザー rocoderrocoder
提出日時 2017-06-11 16:13:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 495 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-09-12 12:58:25
合計ジャッジ時間 819 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,964 KB
testcase_01 AC 15 ms
7,884 KB
testcase_02 AC 16 ms
7,828 KB
testcase_03 AC 16 ms
7,880 KB
testcase_04 AC 16 ms
7,828 KB
testcase_05 AC 16 ms
7,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# your code goes here
def lidi(li):
    A=[]
    i=0
    if li[0]==1:
        li[1]+=10
        i+=1
    while i<len(li)-1:
        if li[i]%2==1:
            li[i+1]+=10
        A.append(li[i]//2)
        i+=1
    A.append(li[i]//2)
    return A
N=input()
Nl=list(N)
Ni=[0]*len(Nl)
for i in range (len(Nl)):
    Ni[i]=int(Nl[i])
Od=0
while len(Ni)>1:
  #  print(Ni)
    if Ni[len(Ni)-1]%2==1:
        Od+=1
    Ni=lidi (Ni)
M=Ni[0]
while M>1:
    if M%2==1:
        Od+=1
    M//=2
print (Od+1)
0