結果

問題 No.471 直列回転機
ユーザー kimiyukikimiyuki
提出日時 2016-12-21 00:25:00
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 423 ms / 3,141 ms
コード長 621 bytes
コンパイル時間 171 ms
コンパイル使用メモリ 10,932 KB
実行使用メモリ 28,192 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:38:35
合計ジャッジ時間 15,295 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
23,616 KB
testcase_01 AC 40 ms
23,372 KB
testcase_02 AC 39 ms
23,488 KB
testcase_03 AC 38 ms
24,240 KB
testcase_04 AC 39 ms
24,336 KB
testcase_05 AC 43 ms
23,440 KB
testcase_06 AC 41 ms
24,276 KB
testcase_07 AC 41 ms
23,652 KB
testcase_08 AC 84 ms
24,220 KB
testcase_09 AC 89 ms
24,288 KB
testcase_10 AC 62 ms
24,588 KB
testcase_11 AC 198 ms
25,520 KB
testcase_12 AC 347 ms
26,964 KB
testcase_13 AC 351 ms
27,052 KB
testcase_14 AC 386 ms
27,676 KB
testcase_15 AC 423 ms
28,192 KB
testcase_16 AC 44 ms
23,368 KB
testcase_17 AC 40 ms
23,412 KB
testcase_18 AC 39 ms
24,000 KB
testcase_19 AC 39 ms
23,988 KB
testcase_20 AC 401 ms
28,096 KB
testcase_21 AC 126 ms
24,372 KB
testcase_22 AC 354 ms
27,200 KB
testcase_23 AC 325 ms
27,100 KB
testcase_24 AC 226 ms
25,660 KB
testcase_25 AC 104 ms
24,692 KB
testcase_26 AC 386 ms
28,156 KB
testcase_27 AC 208 ms
25,924 KB
testcase_28 AC 235 ms
26,344 KB
testcase_29 AC 272 ms
25,964 KB
testcase_30 AC 146 ms
24,536 KB
testcase_31 AC 381 ms
27,648 KB
testcase_32 AC 339 ms
27,360 KB
testcase_33 AC 261 ms
26,380 KB
testcase_34 AC 377 ms
27,396 KB
testcase_35 AC 126 ms
24,760 KB
testcase_36 AC 191 ms
25,260 KB
testcase_37 AC 76 ms
24,896 KB
testcase_38 AC 108 ms
24,640 KB
testcase_39 AC 173 ms
25,076 KB
testcase_40 AC 295 ms
26,764 KB
testcase_41 AC 396 ms
27,816 KB
testcase_42 AC 278 ms
26,136 KB
testcase_43 AC 357 ms
27,356 KB
testcase_44 AC 79 ms
23,984 KB
testcase_45 AC 247 ms
25,928 KB
testcase_46 AC 302 ms
26,584 KB
testcase_47 AC 354 ms
27,420 KB
testcase_48 AC 323 ms
27,156 KB
testcase_49 AC 292 ms
26,820 KB
testcase_50 AC 358 ms
27,372 KB
testcase_51 AC 174 ms
25,540 KB
testcase_52 AC 43 ms
23,680 KB
testcase_53 AC 44 ms
23,528 KB
testcase_54 AC 44 ms
23,976 KB
testcase_55 AC 139 ms
24,852 KB
testcase_56 AC 122 ms
24,260 KB
testcase_57 AC 96 ms
24,236 KB
testcase_58 AC 64 ms
23,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

m = int(input())
x = [ None ] * m
y = [ None ] * m
for i in range(m):
    x[i], y[i] = map(int, input().split())

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
d = df - f

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

print('!')
for i in range(m):
    print(*rotate(x[i], y[i]))
0