結果

問題 No.1226 I hate Robot Arms
ユーザー tyawanmusityawanmusi
提出日時 2020-08-29 17:30:22
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 474 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 84,540 KB
最終ジャッジ日時 2023-08-30 09:35:40
合計ジャッジ時間 8,026 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
77,168 KB
testcase_01 AC 79 ms
76,716 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import radians, sin, cos
n,q=map(int,input().split())
theta=[0]*n
length=[1]*n
for _ in range(q):
  query=list(map(int,input().split()))
  if query[0]==0:
    _,i,x=query
    theta[i-1]=x
  elif query[0]==1:
    _,i,x=query
    length[i-1]=x
  else:
    _,i=query
    x=y=0
    the=0
    for j in range(i):
      the+=theta[j]
      the%=360
      x+=length[j]*cos(radians(the))
      y+=length[j]*sin(radians(the))
    print('{:.9f}'.format(x),'{:.9f}'.format(y))
0