結果

問題 No.471 直列回転機
ユーザー rpy3cpp
提出日時 2017-01-12 01:52:08
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 423 ms / 3,141 ms
コード長 652 bytes
コンパイル時間 298 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 34,264 KB
平均クエリ数 19588.39
最終ジャッジ日時 2024-06-11 10:36:40
合計ジャッジ時間 15,485 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 58
権限があれば一括ダウンロードができます

ソースコード

diff #

M = int(input())
xys = []
for m in range(M):
    x, y = map(int, input().split())
    xys.append((x, y))

print("? 0 0")
x0, y0 = map(int, input().split())
print("? 1 0")
x1, y1 = map(int, input().split())
xx = x1 - x0
yy = y1 - y0
if xx == 1 and yy == 0:
    d = 0
elif xx == 0 and yy == 1:
    d = 90
elif xx == -1 and yy == 0:
    d = 180
elif xx == 0 and yy == -1:
    d = 270
else:
    raise RuntimeError('unexpected result!')

print("!")
for x, y in xys:
    if d == 0:
        print(x0 + x, y0 + y)
    elif d == 90:
        print(x0 - y, y0 + x)
    elif d == 180:
        print(x0 - x, y0 - y)
    elif d == 270:
        print(x0 + y, y0 - x)
0