結果
| 問題 |
No.1226 I hate Robot Arms
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-09-12 13:07:52 |
| 言語 | cLay (20241019-1) |
| 結果 |
AC
|
| 実行時間 | 58 ms / 2,000 ms |
| コード長 | 601 bytes |
| コンパイル時間 | 2,845 ms |
| コンパイル使用メモリ | 177,456 KB |
| 実行使用メモリ | 13,952 KB |
| 最終ジャッジ日時 | 2024-07-05 13:59:00 |
| 合計ジャッジ時間 | 12,528 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / 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;
double sintbl[450];
{
rep(j,450)sintbl[j]=sin(PI/180*j);
rd(n,q);
t.walloc(n+1,1);
rep(q){
rd(y,i);
if(y==0){
rd(x);
M m=t[i-1];
m.c=sintbl[x+90];
m.s=sintbl[x];
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