結果

問題 No.1932 動く点 P / Moving Point P
ユーザー 👑 KazunKazun
提出日時 2022-05-06 23:12:59
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 956 ms / 6,000 ms
コード長 624 bytes
コンパイル時間 1,145 ms
コンパイル使用メモリ 86,132 KB
実行使用メモリ 95,628 KB
最終ジャッジ日時 2023-09-20 05:46:01
合計ジャッジ時間 24,428 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,708 KB
testcase_01 AC 470 ms
91,272 KB
testcase_02 AC 305 ms
90,528 KB
testcase_03 AC 516 ms
79,056 KB
testcase_04 AC 553 ms
82,092 KB
testcase_05 AC 645 ms
83,304 KB
testcase_06 AC 185 ms
83,104 KB
testcase_07 AC 943 ms
95,376 KB
testcase_08 AC 956 ms
95,628 KB
testcase_09 AC 818 ms
94,192 KB
testcase_10 AC 806 ms
94,168 KB
testcase_11 AC 791 ms
94,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def conv(p,q):
    pa,pb=p
    qa,qb=q
    return (pa*qa, pb+pa*qb)

def inv(p):
    pa,pb=p
    return (1/pa,-pb/pa)

from math import *

N=int(input())
d=[None]*(N+1); d[0]=(1,0)
for i in range(N):
    p,q,r=map(float,input().split())

    alpha=complex(p,q)
    theta=r/180*pi
    beta=complex(cos(theta), sin(theta))
    d[i+1]=(beta, alpha*(1-beta))

for i in range(1,N+1):
    d[i]=conv(d[i], d[i-1])

Q=int(input())
for q in range(Q):
    s,t,x,y=input().split()
    s=int(s); t=int(t)
    x=float(x); y=float(y)

    p=conv(d[t],inv(d[s-1]))
    zeta=complex(x,y)
    eta=p[0]*zeta+p[1]
    print(eta.real,eta.imag)
0