結果
| 問題 |
No.1226 I hate Robot Arms
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-09-12 12:49:46 |
| 言語 | cLay (20241019-1) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 558 bytes |
| コンパイル時間 | 2,559 ms |
| コンパイル使用メモリ | 178,768 KB |
| 実行使用メモリ | 14,804 KB |
| 最終ジャッジ日時 | 2024-07-05 13:59:25 |
| 合計ジャッジ時間 | 10,503 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
struct M {
double x,y,c,s;
M operator=(int){
y=s=0;
x=c=1;
return*this;
}
};
M operator*(M a,M b){
M m;
m.x=a.c*b.x-a.s*b.y+a.x;
m.y=a.s*b.x+a.c*b.y+a.y;
m.c=a.c*b.c-a.s*b.s;
m.s=a.s*b.c+a.c*b.s;
return m;
}
segtree_Point_Prod<M>t;
ll n,q,y,i,x;
{
rd(n,q);
t.walloc(n+1,1);
rep(q){
rd(y,i);
if(y==0){
rd(x);
double s=PI*x/180;
M m=t[i-1];
m.c=cos(s);
m.s=sin(s);
t.change(i-1,m);
}
if(y==1){
rd(x);
M m=t[i];
m.x=x;
t.change(i,m);
}
if(y==2){
M m=t.getProd(0,i+1);
wt(m.x-1,m.y);
}
}
}
tails