結果

問題 No.471 直列回転機
ユーザー yuppe19 😺yuppe19 😺
提出日時 2017-03-30 18:34:32
言語 Python2
(2.7.18)
結果
AC  
実行時間 1,277 ms / 3,141 ms
コード長 1,539 bytes
コンパイル時間 1,436 ms
コンパイル使用メモリ 6,656 KB
実行使用メモリ 27,648 KB
平均クエリ数 19589.39
最終ジャッジ日時 2023-09-02 03:57:41
合計ジャッジ時間 37,761 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
23,784 KB
testcase_01 AC 33 ms
23,220 KB
testcase_02 AC 33 ms
23,640 KB
testcase_03 AC 31 ms
24,228 KB
testcase_04 AC 33 ms
23,412 KB
testcase_05 AC 50 ms
23,364 KB
testcase_06 AC 37 ms
23,352 KB
testcase_07 AC 42 ms
23,160 KB
testcase_08 AC 201 ms
23,604 KB
testcase_09 AC 211 ms
23,424 KB
testcase_10 AC 120 ms
23,640 KB
testcase_11 AC 522 ms
24,364 KB
testcase_12 AC 1,058 ms
26,504 KB
testcase_13 AC 1,116 ms
26,920 KB
testcase_14 AC 1,194 ms
27,284 KB
testcase_15 AC 1,252 ms
27,648 KB
testcase_16 AC 39 ms
24,004 KB
testcase_17 AC 31 ms
24,252 KB
testcase_18 AC 33 ms
23,184 KB
testcase_19 AC 34 ms
23,400 KB
testcase_20 AC 1,276 ms
27,368 KB
testcase_21 AC 262 ms
23,640 KB
testcase_22 AC 1,146 ms
26,436 KB
testcase_23 AC 1,129 ms
26,948 KB
testcase_24 AC 584 ms
24,472 KB
testcase_25 AC 215 ms
23,436 KB
testcase_26 AC 1,277 ms
27,488 KB
testcase_27 AC 597 ms
24,132 KB
testcase_28 AC 724 ms
25,156 KB
testcase_29 AC 795 ms
25,084 KB
testcase_30 AC 336 ms
24,016 KB
testcase_31 AC 1,270 ms
27,188 KB
testcase_32 AC 1,013 ms
26,292 KB
testcase_33 AC 822 ms
25,372 KB
testcase_34 AC 1,264 ms
27,144 KB
testcase_35 AC 282 ms
24,180 KB
testcase_36 AC 492 ms
24,088 KB
testcase_37 AC 158 ms
23,388 KB
testcase_38 AC 247 ms
23,160 KB
testcase_39 AC 380 ms
23,436 KB
testcase_40 AC 908 ms
25,728 KB
testcase_41 AC 1,232 ms
27,516 KB
testcase_42 AC 812 ms
25,564 KB
testcase_43 AC 1,155 ms
26,976 KB
testcase_44 AC 127 ms
23,416 KB
testcase_45 AC 743 ms
25,116 KB
testcase_46 AC 885 ms
25,380 KB
testcase_47 AC 1,241 ms
27,012 KB
testcase_48 AC 986 ms
26,720 KB
testcase_49 AC 982 ms
26,324 KB
testcase_50 AC 1,236 ms
26,988 KB
testcase_51 AC 496 ms
24,168 KB
testcase_52 AC 44 ms
23,988 KB
testcase_53 AC 46 ms
23,160 KB
testcase_54 AC 52 ms
23,628 KB
testcase_55 AC 295 ms
23,640 KB
testcase_56 AC 229 ms
23,412 KB
testcase_57 AC 156 ms
23,640 KB
testcase_58 AC 115 ms
23,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
# -*- coding: utf-8 -*-
# †
import sys
from itertools import chain, repeat

def Struct(name, fields):
    fields = fields.replace(',', ' ').split()
    def __init__(self, *args):
        n, m = len(args), len(fields)
        if n > m:
            raise TypeError('__init__() takes at most {} arguments ({} given)'.format(m, n))
        args = chain(args, repeat(None))
        for field, value in zip(fields, args):
            setattr(self, field, value)
    def __str__(self):
        return '{}({})'.format(name, ', '.join('{}={}'.format(f, getattr(self, f)) for f in fields))
    def __getitem__(self, index):
        return getattr(self, fields[index])
    def __setitem__(self, index, value):
        setattr(self, fields[index], value)
    attrs = {
        '__slots__': fields,
        '__init__':  __init__,
        '__getitem__': __getitem__,
        '__setitem__': __setitem__,
        '__str__':  __str__,
        '__repr__': __str__,
    }
    return type(name, (object,), attrs)

P = Struct('P', 'x, y')

def nya(mes):
    print mes
    sys.stdout.flush()


M = int(raw_input())
points = [P(*map(int, raw_input().split())) for _ in xrange(M)]

nya('? 0 0')
p00 = P(*map(int, raw_input().split()))
nya('? 1 0')
p10 = P(*map(int, raw_input().split()))
p10.x -= p00.x
p10.y -= p00.y
nya('? 0 1')
p01 = P(*map(int, raw_input().split()))
p01.x -= p00.x
p01.y -= p00.y

nya('!')
for p in points:
    x = p10.x * p.x + p01.x * p.y + p00.x
    y = p10.y * p.x + p01.y * p.y + p00.y
    nya('{} {}'.format(x, y))
0