結果

問題 No.2449 square_permutation
ユーザー tailstails
提出日時 2023-08-31 21:26:48
言語 cLay
(20240104-1)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 2,898 ms
コンパイル使用メモリ 167,044 KB
実行使用メモリ 20,004 KB
最終ジャッジ日時 2023-08-31 21:26:55
合計ジャッジ時間 6,616 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
4,380 KB
testcase_01 AC 3 ms
4,380 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 4 ms
4,384 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 4 ms
4,380 KB
testcase_06 AC 19 ms
9,080 KB
testcase_07 AC 21 ms
9,732 KB
testcase_08 AC 22 ms
10,396 KB
testcase_09 AC 26 ms
11,772 KB
testcase_10 AC 40 ms
14,644 KB
testcase_11 AC 45 ms
15,468 KB
testcase_12 AC 45 ms
16,216 KB
testcase_13 AC 61 ms
19,636 KB
testcase_14 AC 64 ms
19,816 KB
testcase_15 AC 61 ms
20,004 KB
testcase_16 AC 59 ms
19,728 KB
testcase_17 AC 61 ms
19,740 KB
testcase_18 AC 61 ms
18,208 KB
testcase_19 AC 61 ms
19,480 KB
testcase_20 AC 63 ms
19,752 KB
testcase_21 AC 63 ms
19,756 KB
testcase_22 AC 3 ms
4,384 KB
testcase_23 AC 61 ms
19,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

ll@n,a[n+1];
VI v[n+1];
a[0..n]=(0..);
int pr[500];
rep[pr](p,Prime(548,pr)){
	ll pp=(ll)p*p;
	for(ll j=1;j*=pp,j<=n;){
		rep(k,n/j+1){
			a[k*j]/=pp;
		}
	}
}
rep(i,1,n+1){
	v[a[i]].push_back(i);
}
rep(i,1,n+1){
	wtSp(v[a[i]].back());
	v[a[i]].pop_back();
}
0