結果

問題 No.1226 I hate Robot Arms
ユーザー tailstails
提出日時 2020-09-25 00:31:49
言語 cLay
(20240104-1)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 578 bytes
コンパイル時間 2,824 ms
コンパイル使用メモリ 176,472 KB
実行使用メモリ 13,248 KB
最終ジャッジ日時 2023-09-19 01:24:09
合計ジャッジ時間 12,389 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 17 ms
5,512 KB
testcase_03 AC 20 ms
6,492 KB
testcase_04 AC 24 ms
11,432 KB
testcase_05 AC 23 ms
11,896 KB
testcase_06 AC 51 ms
12,624 KB
testcase_07 AC 16 ms
5,528 KB
testcase_08 AC 10 ms
10,520 KB
testcase_09 AC 35 ms
7,324 KB
testcase_10 AC 5 ms
4,472 KB
testcase_11 AC 27 ms
11,552 KB
testcase_12 AC 15 ms
7,648 KB
testcase_13 AC 15 ms
11,488 KB
testcase_14 AC 42 ms
7,420 KB
testcase_15 AC 8 ms
10,624 KB
testcase_16 AC 50 ms
12,792 KB
testcase_17 AC 15 ms
6,352 KB
testcase_18 AC 11 ms
6,532 KB
testcase_19 AC 28 ms
11,492 KB
testcase_20 AC 27 ms
11,200 KB
testcase_21 AC 34 ms
11,700 KB
testcase_22 AC 53 ms
12,992 KB
testcase_23 AC 54 ms
12,996 KB
testcase_24 AC 54 ms
13,248 KB
testcase_25 AC 54 ms
12,940 KB
testcase_26 AC 53 ms
13,052 KB
testcase_27 AC 64 ms
12,928 KB
testcase_28 AC 64 ms
13,084 KB
testcase_29 AC 64 ms
12,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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