結果
| 問題 | No.3501 Digit Products 2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-18 04:32:33 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 628 bytes |
| 記録 | |
| コンパイル時間 | 748 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 40,612 KB |
| 平均クエリ数 | 1.00 |
| 最終ジャッジ日時 | 2026-04-18 04:33:25 |
| 合計ジャッジ時間 | 39,031 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 72 |
ソースコード
# ask queries:
products = [None]*N
for i in range(1, N):
print(f"? 0 {i}", flush=True)
products[i] = int(input())
# try all possible d0
candidates = []
for d0 in range(1, 10):
digits = [0]*N
digits[0] = d0
ok = True
for i in range(1, N):
if products[i] % d0 != 0:
ok = False
break
digits[i] = products[i] // d0
if not (0 <= digits[i] <= 9):
ok = False
if ok:
candidates.append(digits)
# check uniqueness
if len(candidates) == 1:
print("!", "".join(map(str, candidates[0])), flush=True)
else:
print("! -1", flush=True)