結果

問題 No.1226 I hate Robot Arms
ユーザー tailstails
提出日時 2020-09-12 13:07:52
言語 cLay
(20240104-1)
結果
AC  
実行時間 61 ms / 2,000 ms
コード長 601 bytes
コンパイル時間 2,562 ms
コンパイル使用メモリ 166,184 KB
実行使用メモリ 15,264 KB
最終ジャッジ日時 2023-09-19 01:07:13
合計ジャッジ時間 15,832 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 17 ms
7,696 KB
testcase_03 AC 19 ms
7,876 KB
testcase_04 AC 22 ms
13,984 KB
testcase_05 AC 20 ms
13,948 KB
testcase_06 AC 47 ms
15,036 KB
testcase_07 AC 16 ms
7,596 KB
testcase_08 AC 9 ms
13,224 KB
testcase_09 AC 33 ms
8,572 KB
testcase_10 AC 6 ms
4,544 KB
testcase_11 AC 24 ms
14,340 KB
testcase_12 AC 14 ms
9,464 KB
testcase_13 AC 12 ms
13,344 KB
testcase_14 AC 39 ms
8,720 KB
testcase_15 AC 6 ms
13,228 KB
testcase_16 AC 47 ms
15,064 KB
testcase_17 AC 15 ms
7,540 KB
testcase_18 AC 10 ms
7,236 KB
testcase_19 AC 25 ms
14,236 KB
testcase_20 AC 23 ms
14,072 KB
testcase_21 AC 30 ms
14,372 KB
testcase_22 AC 48 ms
14,904 KB
testcase_23 AC 48 ms
15,012 KB
testcase_24 AC 50 ms
14,904 KB
testcase_25 AC 50 ms
15,264 KB
testcase_26 AC 52 ms
14,928 KB
testcase_27 AC 60 ms
14,936 KB
testcase_28 AC 61 ms
15,032 KB
testcase_29 AC 60 ms
14,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
		}
	}
}
0