結果

問題 No.1152 10億ゲーム
ユーザー takakintakakin
提出日時 2020-08-08 22:00:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 740 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 24,604 KB
平均クエリ数 22.98
最終ジャッジ日時 2023-09-24 05:26:18
合計ジャッジ時間 7,788 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
23,844 KB
testcase_01 AC 82 ms
24,000 KB
testcase_02 AC 83 ms
24,044 KB
testcase_03 AC 83 ms
24,276 KB
testcase_04 AC 84 ms
24,088 KB
testcase_05 AC 83 ms
24,064 KB
testcase_06 AC 84 ms
23,900 KB
testcase_07 AC 83 ms
24,500 KB
testcase_08 AC 82 ms
24,020 KB
testcase_09 AC 83 ms
24,176 KB
testcase_10 AC 81 ms
24,088 KB
testcase_11 AC 82 ms
24,432 KB
testcase_12 AC 84 ms
24,196 KB
testcase_13 AC 83 ms
24,340 KB
testcase_14 AC 82 ms
24,060 KB
testcase_15 AC 83 ms
24,368 KB
testcase_16 AC 81 ms
23,908 KB
testcase_17 AC 83 ms
24,604 KB
testcase_18 AC 84 ms
23,952 KB
testcase_19 AC 83 ms
23,844 KB
testcase_20 AC 82 ms
24,100 KB
testcase_21 AC 81 ms
24,448 KB
testcase_22 AC 82 ms
24,368 KB
testcase_23 AC 82 ms
24,368 KB
testcase_24 AC 82 ms
24,400 KB
testcase_25 AC 83 ms
24,088 KB
testcase_26 AC 83 ms
24,296 KB
testcase_27 AC 82 ms
24,032 KB
testcase_28 AC 83 ms
23,944 KB
testcase_29 AC 83 ms
24,020 KB
testcase_30 AC 84 ms
23,956 KB
testcase_31 AC 83 ms
24,204 KB
testcase_32 AC 84 ms
24,528 KB
testcase_33 AC 83 ms
24,304 KB
testcase_34 AC 83 ms
24,520 KB
testcase_35 AC 82 ms
24,476 KB
testcase_36 AC 83 ms
23,928 KB
testcase_37 AC 83 ms
23,864 KB
testcase_38 AC 81 ms
24,192 KB
testcase_39 AC 80 ms
23,956 KB
testcase_40 AC 80 ms
23,968 KB
testcase_41 AC 81 ms
24,468 KB
testcase_42 AC 82 ms
24,116 KB
testcase_43 AC 81 ms
24,212 KB
testcase_44 AC 81 ms
24,364 KB
testcase_45 AC 83 ms
24,328 KB
testcase_46 AC 81 ms
24,224 KB
testcase_47 AC 82 ms
23,892 KB
testcase_48 AC 82 ms
24,376 KB
testcase_49 AC 82 ms
23,952 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)]
			elif i1>7:
				x1=D1[(i1-1,j1)]
			else:
				x1=D1[(i1+1,j1)]
		print(x1,flush=True)
		x2=int(input())
		if x1==x2:
			sys.exit()
0