結果

問題 No.620 ぐるぐるぐるりん
ユーザー maspymaspy
提出日時 2020-05-03 12:23:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 969 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 10,972 KB
実行使用メモリ 8,300 KB
最終ジャッジ日時 2023-09-02 12:25:49
合計ジャッジ時間 4,775 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,796 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 AC 16 ms
7,792 KB
testcase_04 AC 16 ms
7,764 KB
testcase_05 AC 16 ms
7,836 KB
testcase_06 AC 16 ms
7,936 KB
testcase_07 AC 16 ms
7,804 KB
testcase_08 WA -
testcase_09 AC 16 ms
7,804 KB
testcase_10 AC 16 ms
7,780 KB
testcase_11 AC 16 ms
7,860 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 16 ms
7,936 KB
testcase_25 AC 17 ms
7,832 KB
testcase_26 AC 29 ms
8,300 KB
testcase_27 AC 16 ms
7,784 KB
testcase_28 WA -
testcase_29 AC 29 ms
8,204 KB
testcase_30 AC 29 ms
8,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def solve(T, p, w, v, gx, gy):
    T = int(T)
    p, w, v, gx, gy = map(float, (p, w, v, gx, gy))
    r = complex(1 + v, w)
    g = complex(gx, gy) - r**T
    power = [0] * T
    n = 0 if abs(r) > 1 else T - 1
    r = r**(T - 1 - n)
    d = g / r
    for i in range(T):
        if i != n:
            yield (0, 0)
        else:
            yield (d.real, d.imag)

"""
def check(w, v, gx, gy, uvs):
    z = 1
    r = complex(1 + v, w)
    for dx, dy in uvs:
        z *= r
        z += complex(dx, dy)
    return abs(z - complex(gx, gy)) < 1e-6


uvs = ((1, 0), (1, 0), (1, 0), (0, 1), (0, 1))
check(0.5, -0.5, -1.125, 2.125, uvs)"""

N = int(readline())
probs = readlines()

for prob in probs:
    p, w, v, gx, gy = map(float, prob[2:].split())
    uvs = solve(*prob.split())
    print('\n'.join('{} {}'.format(x, y) for x, y in solve(*prob.split())))
0