結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 18 ms
7,616 KB
testcase_03 AC 21 ms
7,780 KB
testcase_04 AC 24 ms
13,840 KB
testcase_05 AC 21 ms
13,892 KB
testcase_06 AC 50 ms
14,856 KB
testcase_07 AC 17 ms
7,568 KB
testcase_08 AC 9 ms
13,180 KB
testcase_09 AC 35 ms
8,500 KB
testcase_10 AC 5 ms
4,464 KB
testcase_11 AC 26 ms
13,960 KB
testcase_12 AC 14 ms
9,388 KB
testcase_13 AC 13 ms
13,400 KB
testcase_14 AC 41 ms
8,648 KB
testcase_15 AC 6 ms
12,972 KB
testcase_16 AC 50 ms
14,892 KB
testcase_17 AC 15 ms
7,400 KB
testcase_18 AC 10 ms
7,272 KB
testcase_19 AC 26 ms
14,056 KB
testcase_20 AC 24 ms
13,908 KB
testcase_21 AC 32 ms
14,296 KB
testcase_22 AC 50 ms
15,112 KB
testcase_23 AC 50 ms
14,856 KB
testcase_24 AC 51 ms
14,868 KB
testcase_25 AC 51 ms
14,860 KB
testcase_26 AC 53 ms
14,856 KB
testcase_27 AC 62 ms
14,912 KB
testcase_28 AC 62 ms
14,844 KB
testcase_29 AC 62 ms
14,984 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;

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