結果

問題 No.1152 10億ゲーム
ユーザー takakintakakin
提出日時 2020-08-08 21:58:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 705 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 10,748 KB
実行使用メモリ 24,504 KB
平均クエリ数 21.86
最終ジャッジ日時 2023-09-24 05:27:03
合計ジャッジ時間 6,268 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
23,952 KB
testcase_01 AC 71 ms
24,068 KB
testcase_02 AC 69 ms
24,304 KB
testcase_03 AC 67 ms
23,720 KB
testcase_04 AC 64 ms
24,456 KB
testcase_05 AC 72 ms
24,128 KB
testcase_06 AC 68 ms
24,504 KB
testcase_07 AC 68 ms
23,720 KB
testcase_08 AC 70 ms
24,316 KB
testcase_09 AC 70 ms
23,952 KB
testcase_10 AC 66 ms
23,888 KB
testcase_11 AC 67 ms
23,884 KB
testcase_12 AC 69 ms
23,944 KB
testcase_13 AC 69 ms
24,328 KB
testcase_14 AC 70 ms
23,964 KB
testcase_15 AC 67 ms
24,320 KB
testcase_16 AC 69 ms
24,156 KB
testcase_17 AC 71 ms
23,844 KB
testcase_18 AC 68 ms
23,772 KB
testcase_19 AC 69 ms
23,752 KB
testcase_20 AC 70 ms
24,340 KB
testcase_21 AC 67 ms
24,412 KB
testcase_22 AC 65 ms
23,912 KB
testcase_23 AC 67 ms
23,724 KB
testcase_24 AC 70 ms
23,952 KB
testcase_25 AC 70 ms
24,176 KB
testcase_26 AC 75 ms
23,892 KB
testcase_27 AC 71 ms
23,900 KB
testcase_28 AC 70 ms
24,036 KB
testcase_29 AC 66 ms
24,492 KB
testcase_30 AC 67 ms
23,720 KB
testcase_31 AC 65 ms
24,416 KB
testcase_32 AC 65 ms
24,372 KB
testcase_33 AC 74 ms
24,020 KB
testcase_34 AC 70 ms
24,340 KB
testcase_35 AC 66 ms
24,272 KB
testcase_36 AC 66 ms
24,388 KB
testcase_37 AC 69 ms
23,960 KB
testcase_38 AC 66 ms
24,456 KB
testcase_39 AC 67 ms
23,840 KB
testcase_40 AC 70 ms
24,096 KB
testcase_41 AC 67 ms
24,024 KB
testcase_42 AC 68 ms
23,856 KB
testcase_43 AC 75 ms
23,904 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 AC 70 ms
23,996 KB
testcase_47 AC 69 ms
24,200 KB
testcase_48 AC 68 ms
23,912 KB
testcase_49 AC 70 ms
24,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
D1,D2=dict(),dict()
for i in range(10):
	for j in range(10):
		D1[(i,j)]=2**i*5**j
		D2[2**i*5**j]=(i,j)

x1,x2=map(int,input().split())
while True:
	if 2*x1==x2 or 5*x1==x2 or x1==2*x2 or x1==5*x2:
		print(x2,flush=True)
		sys.exit()
	else:
		i1,j1=D2[x1]
		i2,j2=D2[x2]
		if (i1+j1)%2!=(i2+j2)%2:
			if abs(i1-i2)>abs(j1-j2):
				if i1<i2:
					x1=D1[(i1+1,j1)]
				else:
					x1=D1[(i1-1,j1)]
			else:
				if j1<j2:
					x1=D1[(i1,j1+1)]
				else:
					x1=D1[(i1,j1-1)]
		else:
			if i1==7 and j1==9:
				x1=10**9
			elif i1==7:
				x1=D1[(i1,j1+1)]
			else:
				x1=D1[(i1+1,j1)]
		print(x1,flush=True)
		x2=int(input())
		if x1==x2:
			sys.exit()
0