結果

問題 No.2249 GCDistance
ユーザー tailstails
提出日時 2023-03-18 13:49:31
言語 cLay
(20240104-1)
結果
AC  
実行時間 346 ms / 5,000 ms
コード長 310 bytes
コンパイル時間 2,547 ms
コンパイル使用メモリ 174,616 KB
実行使用メモリ 83,808 KB
最終ジャッジ日時 2023-10-18 17:16:25
合計ジャッジ時間 7,960 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 307 ms
82,132 KB
testcase_01 AC 343 ms
83,808 KB
testcase_02 AC 342 ms
83,808 KB
testcase_03 AC 346 ms
83,808 KB
testcase_04 AC 324 ms
83,344 KB
testcase_05 AC 345 ms
83,808 KB
testcase_06 AC 345 ms
83,808 KB
testcase_07 AC 343 ms
83,808 KB
testcase_08 AC 307 ms
82,176 KB
testcase_09 AC 339 ms
83,808 KB
testcase_10 AC 333 ms
83,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ull d[1d7+2];
{
	rep(i,1,1d7+2>>1){
		d[i*2+0]=i;
		d[i*2+1]=i*2+1;
	}
	rep(i,3,1d7+1){
		if(d[i]==i){
			unsigned v=i;
			v*=2-i*v;
			v*=2-i*v;
			v*=2-i*v;
			v*=2-i*v;
			v*=i-1;
			rep(j,i,1d7+1,i){
				d[j]=(unsigned)d[j]*v;
			}
		}
		d[i]=d[i-1]-d[i]+i*2-2;
	}
	ll@t;
	rep(t){
		ll@n;
		wt(d[n]);
	}
}
0