結果

問題 No.1932 動く点 P / Moving Point P
ユーザー LayCurseLayCurse
提出日時 2022-05-06 22:24:32
言語 cLay
(20240104-1)
結果
AC  
実行時間 476 ms / 6,000 ms
コード長 648 bytes
コンパイル時間 6,163 ms
コンパイル使用メモリ 210,320 KB
実行使用メモリ 39,456 KB
最終ジャッジ日時 2023-09-20 03:23:37
合計ジャッジ時間 25,301 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 147 ms
35,856 KB
testcase_02 AC 95 ms
34,608 KB
testcase_03 AC 195 ms
8,136 KB
testcase_04 AC 246 ms
14,416 KB
testcase_05 AC 216 ms
14,328 KB
testcase_06 AC 46 ms
20,172 KB
testcase_07 AC 476 ms
39,352 KB
testcase_08 AC 470 ms
39,456 KB
testcase_09 AC 279 ms
39,452 KB
testcase_10 AC 284 ms
39,456 KB
testcase_11 AC 284 ms
39,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int N, S, T;
double P[1d5], Q[], R[], X, Y, rx, ry;
Matrix<double> m[3], mt;
segtree_Point_Prod<Matrix<double>> t;

rd(N,(P,Q,R)(N));
t.walloc(N);
t.setN(N);
rep(i,3) m[i].changeSize(3,3);
rep(i,N){
  m[0] = m[1] = m[2] = 1;

  (m[0][2][0], m[0][2][1]) = (-P[i], -Q[i]);
  (m[2][2][0], m[2][2][1]) = (P[i], Q[i]);

  m[1][0][0] = m[1][1][1] = cos(R[i] * PI / 180);
  m[1][0][1] = sin(R[i] * PI / 180);
  m[1][1][0] = -sin(R[i] * PI / 180);
  t[i] = m[0] * m[1] * m[2];
}
t.build();

REP(rd_int()){
  rd(S--,T,X,Y);
  mt = t.getProd(S, T);
  rx = X * mt[0][0] + Y * mt[1][0] + mt[2][0];
  ry = X * mt[0][1] + Y * mt[1][1] + mt[2][1];
  wt(rx,ry);
}
0