結果
| 問題 | No.423 ハムスター語初級(数詞) |
| コンテスト | |
| ユーザー |
Shoya SATO
|
| 提出日時 | 2020-10-09 15:28:20 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 693 bytes |
| 記録 | |
| コンパイル時間 | 199 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,624 KB |
| 最終ジャッジ日時 | 2024-07-20 06:49:34 |
| 合計ジャッジ時間 | 1,185 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 7 RE * 1 |
ソースコード
#ham=0 hamu=1 hamstring=大腿後面筋
n=list(input())
n+=['string']
y=0
b=[]
#print(n)
for _ in n:
if n[y] =='m':
if n[y+1]=='h':
b+=[0]
elif n[y+1]=='u':
b+=[1]
y+=1
#print(b)
if b[0]==0:
b.pop(0)
b_len=len(b)-1
z=0
for x in b:
z+=x*(2**b_len)
b_len-=1
#print(z)
z*=2
#print(z)
c=''
d=2
e=0
while z >1:
#print(z)
if z<2**e:
c+='0'
#print('z<2**e')
else:
while z>2**(e+1):
e+=1
#print('e+=1')
z-=2**e
e-=1
d=2
c+='1'
# print(z)
if z ==1:
c+='1'
else:
c+='0'
c_list=list(c)
print_ham=''
for x in c_list:
if x =='1':
print_ham+='hamu'
else:
print_ham+='ham'
print(print_ham)
Shoya SATO