結果

問題 No.471 直列回転機
コンテスト
ユーザー kimiyuki
提出日時 2016-12-21 00:18:05
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 565 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 412 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 39,760 KB
平均クエリ数 1.00
最終ジャッジ日時 2026-03-30 23:40:35
合計ジャッジ時間 29,244 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 58
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#!/usr/bin/env python3
import sys

def ask(x, y):
    print('?', x, y)
    sys.stdout.flush()
    fx, fy = map(int, input().split())
    return fx, fy

# [ x' ]   [ a b e ] [ x ]
# [ y' ] = [ c d f ] [ y ]
# [ 1  ]   [     1 ] [ 1 ]
ae, cf = ask(1, 0)
aae, ccf = ask(2, 0)
a = aae - ae
e = ae - a
c = ccf - cf
f = cf - c
be, df = ask(0, 1)
b = be - e
df = df - f

def f(x, y):
    fx = a*x + b*y + e
    fy = c*x + d*y + f
    return fx, fy

print('!')
sys.stdout.flush()
m = int(input())
for _ in range(m):
    x, y = map(int, input().split())
    print(*f(x, y))
0