結果

問題 No.3501 Digit Products 2
コンテスト
ユーザー uselessman
提出日時 2026-04-18 17:18:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 518 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 432 ms
コンパイル使用メモリ 84,940 KB
実行使用メモリ 87,836 KB
平均クエリ数 2.00
最終ジャッジ日時 2026-04-18 17:19:08
合計ジャッジ時間 20,353 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other WA * 11 RE * 61
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
n = int(input())
a = [0 for _ in range(n)]
c0 = 0
for i in range(n-1):
	print('? '+str(n-1)+' '+str(i),flush = True)
	x = int(input())
	a[i] = x
	if x == 0:
		c0 += 1
if n-1-c0 < 2:
	print('! -1',flush = True)
	exit()
t = []
for i in range(n-1):
	if a[i] != 0:
		t.append(i)
		if len(t) == 2:
			break
print('? '+str(t[0])+' '+str(t[1]),flush = True)
x = int(input())
a[n-1] = math.isqrt(a[t[0]]*a[t[1]]//x)
for i in range(n-1):
	a[i] //= a[n-1]
ans = ''.join(map(str,a[::-1]))
print('! '+ans,flush = True)
0