結果

問題 No.1226 I hate Robot Arms
ユーザー tailstails
提出日時 2020-09-11 23:33:16
言語 cLay
(20240104-1)
結果
AC  
実行時間 86 ms / 2,000 ms
コード長 744 bytes
コンパイル時間 2,975 ms
コンパイル使用メモリ 179,652 KB
実行使用メモリ 25,196 KB
最終ジャッジ日時 2023-09-19 01:07:28
合計ジャッジ時間 13,404 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 23 ms
7,644 KB
testcase_03 AC 27 ms
9,724 KB
testcase_04 AC 37 ms
24,148 KB
testcase_05 AC 34 ms
23,988 KB
testcase_06 AC 77 ms
25,120 KB
testcase_07 AC 21 ms
7,508 KB
testcase_08 AC 14 ms
23,560 KB
testcase_09 AC 45 ms
10,556 KB
testcase_10 AC 7 ms
7,064 KB
testcase_11 AC 40 ms
24,224 KB
testcase_12 AC 21 ms
15,588 KB
testcase_13 AC 21 ms
23,544 KB
testcase_14 AC 56 ms
10,732 KB
testcase_15 AC 11 ms
23,200 KB
testcase_16 AC 74 ms
25,140 KB
testcase_17 AC 19 ms
9,540 KB
testcase_18 AC 14 ms
9,188 KB
testcase_19 AC 41 ms
24,240 KB
testcase_20 AC 37 ms
24,116 KB
testcase_21 AC 49 ms
24,712 KB
testcase_22 AC 78 ms
25,100 KB
testcase_23 AC 80 ms
25,196 KB
testcase_24 AC 77 ms
25,176 KB
testcase_25 AC 77 ms
25,132 KB
testcase_26 AC 79 ms
25,144 KB
testcase_27 AC 86 ms
25,108 KB
testcase_28 AC 84 ms
25,148 KB
testcase_29 AC 84 ms
25,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

struct M {
	double m[3][3];
	M operator=(int){
		m[0][0]=1; m[0][1]=0; m[0][2]=1;
		m[1][0]=0; m[1][1]=1; m[1][2]=0;
		m[2][0]=0; m[2][1]=0; m[2][2]=1;
		return *this;
	}
};

M operator*(M m1,M m2){
	M m3;
	rep(i,3)rep(j,3){m3.m[i][j]=0;rep(k,3)m3.m[i][j]+=m1.m[i][k]*m2.m[k][j];}
	return m3;
}

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

{
	rd(n,q);
	t.walloc(n+1,1);
	{
		M m=t[0];
		m.m[0][2]=0;
		t.change(0,m);
	}
	rep(q){
		rd(y,i);
		if(y==0){
			rd(x);
			double s=PI*x/180;
			M m=t[i-1];
			m.m[0][0]=cos(s); m.m[0][1]=-sin(s);
			m.m[1][0]=sin(s); m.m[1][1]=cos(s);
			t.change(i-1,m);
		}
		if(y==1){
			rd(x);
			M m=t[i];
			m.m[0][2]=x;
			t.change(i,m);
		}
		if(y==2){
			M m=t.getProd(0,i+1);
			wt(m.m[0][2],m.m[1][2]);
		}
	}
}
0