結果
| 問題 |
No.1226 I hate Robot Arms
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-09-25 00:31:49 |
| 言語 | cLay (20241019-1) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| コード長 | 578 bytes |
| コンパイル時間 | 2,400 ms |
| コンパイル使用メモリ | 177,368 KB |
| 実行使用メモリ | 12,928 KB |
| 最終ジャッジ日時 | 2024-07-05 14:16:34 |
| 合計ジャッジ時間 | 9,725 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 28 |
ソースコード
struct M {
double x,y,c,s;
};
void segtree_pg_func(M&r,M&a,M&b){
r={
a.c*b.x-a.s*b.y+a.x,
a.s*b.x+a.c*b.y+a.y,
a.c*b.c-a.s*b.s,
a.s*b.c+a.c*b.s,
};
}
segtree_pg<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);
t.setN(n+1);
rep[t](m,n+1)m={1,0,1,0};
t.build();
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.get(0,i+1);
wt(m.x-1,m.y);
}
}
}
tails