結果

問題 No.2787 グッドスタイン数列?
ユーザー 👑 p-adicp-adic
提出日時 2023-05-18 19:06:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 35 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 53,964 KB
最終ジャッジ日時 2024-06-14 20:50:19
合計ジャッジ時間 3,145 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,356 KB
testcase_01 AC 35 ms
53,232 KB
testcase_02 AC 35 ms
52,784 KB
testcase_03 AC 34 ms
52,852 KB
testcase_04 AC 32 ms
52,496 KB
testcase_05 AC 32 ms
52,268 KB
testcase_06 AC 33 ms
52,880 KB
testcase_07 AC 33 ms
52,988 KB
testcase_08 AC 32 ms
52,604 KB
testcase_09 AC 32 ms
52,560 KB
testcase_10 AC 34 ms
53,288 KB
testcase_11 AC 34 ms
51,872 KB
testcase_12 AC 32 ms
52,532 KB
testcase_13 AC 34 ms
53,136 KB
testcase_14 AC 34 ms
51,944 KB
testcase_15 AC 34 ms
52,732 KB
testcase_16 AC 33 ms
52,780 KB
testcase_17 AC 33 ms
53,020 KB
testcase_18 AC 32 ms
53,800 KB
testcase_19 AC 34 ms
52,712 KB
testcase_20 AC 33 ms
52,844 KB
testcase_21 AC 35 ms
52,872 KB
testcase_22 AC 35 ms
52,404 KB
testcase_23 AC 34 ms
53,564 KB
testcase_24 AC 34 ms
53,620 KB
testcase_25 AC 33 ms
52,760 KB
testcase_26 AC 31 ms
53,964 KB
testcase_27 AC 33 ms
52,200 KB
testcase_28 AC 33 ms
52,128 KB
testcase_29 AC 33 ms
52,404 KB
testcase_30 AC 32 ms
53,436 KB
testcase_31 AC 34 ms
53,092 KB
testcase_32 AC 33 ms
52,844 KB
testcase_33 AC 33 ms
53,096 KB
testcase_34 AC 33 ms
53,632 KB
testcase_35 AC 33 ms
52,632 KB
testcase_36 AC 32 ms
52,568 KB
testcase_37 AC 31 ms
52,356 KB
testcase_38 AC 31 ms
53,356 KB
testcase_39 AC 31 ms
53,320 KB
testcase_40 AC 34 ms
52,144 KB
testcase_41 AC 32 ms
53,380 KB
testcase_42 AC 35 ms
53,000 KB
testcase_43 AC 33 ms
52,752 KB
testcase_44 AC 33 ms
52,932 KB
testcase_45 AC 33 ms
51,876 KB
testcase_46 AC 33 ms
52,988 KB
testcase_47 AC 31 ms
52,320 KB
testcase_48 AC 32 ms
53,092 KB
testcase_49 AC 32 ms
52,272 KB
testcase_50 AC 33 ms
52,072 KB
testcase_51 AC 33 ms
52,304 KB
testcase_52 AC 33 ms
53,620 KB
testcase_53 AC 33 ms
51,752 KB
testcase_54 AC 32 ms
52,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

R,P=range,print
N,B,C=map(int,input().split())
f=[0]*64
P("Yes")
for d in R(64):f[d],N=N%B,N//B
c,B,f[0]=f[0]*2,B+f[0],0
def D(d):
	global c,B
	if c>=C:return
	a=B
	B,c=B*2+1,c+B*2+2
	if d>1:
		f[d]-=1
		for e in R(1,d):
			f[e]=a
			for i in R(a):
				D(e)
				if c>=C:return
	else:f[1]-=1
for d in R(1,64):
	for i in R(f[d]):
		D(d)
		if c>=C:P("No"),exit(0)
c+=2
if c<=C:P("Yes"),P(c),exit(0)
P("No")
0