結果

問題 No.1226 I hate Robot Arms
ユーザー tailstails
提出日時 2020-09-24 15:08:57
言語 cLay
(20240104-1)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 2,725 ms
コンパイル使用メモリ 167,180 KB
実行使用メモリ 13,064 KB
最終ジャッジ日時 2023-09-19 01:21:47
合計ジャッジ時間 12,375 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 17 ms
5,604 KB
testcase_03 AC 21 ms
7,856 KB
testcase_04 AC 24 ms
11,884 KB
testcase_05 AC 22 ms
11,760 KB
testcase_06 AC 53 ms
12,900 KB
testcase_07 AC 16 ms
5,476 KB
testcase_08 AC 8 ms
11,272 KB
testcase_09 AC 35 ms
8,656 KB
testcase_10 AC 6 ms
4,448 KB
testcase_11 AC 27 ms
12,008 KB
testcase_12 AC 15 ms
9,464 KB
testcase_13 AC 13 ms
11,476 KB
testcase_14 AC 42 ms
8,816 KB
testcase_15 AC 7 ms
11,084 KB
testcase_16 AC 51 ms
12,936 KB
testcase_17 AC 15 ms
7,472 KB
testcase_18 AC 11 ms
7,312 KB
testcase_19 AC 27 ms
12,104 KB
testcase_20 AC 26 ms
12,012 KB
testcase_21 AC 33 ms
12,544 KB
testcase_22 AC 53 ms
12,900 KB
testcase_23 AC 53 ms
12,916 KB
testcase_24 AC 53 ms
12,908 KB
testcase_25 AC 54 ms
13,064 KB
testcase_26 AC 52 ms
12,888 KB
testcase_27 AC 64 ms
13,032 KB
testcase_28 AC 65 ms
12,908 KB
testcase_29 AC 64 ms
12,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

double sintbl[360];

struct M {
	double x,y;int d;
	void operator=(int){
		x=1; y=0; d=0;
	}
};

M operator*(M a,M b){
	double c=sintbl[(a.d+90)%360];
	double s=sintbl[a.d%360];
	return {
		c*b.x-s*b.y+a.x,
		s*b.x+c*b.y+a.y,
		a.d+b.d,
	};
}

segtree_Point_Prod<M>t;
ll n,q,y,i,x;

{
	rep(j,360)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.d=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