結果

問題 No.2449 square_permutation
ユーザー tailstails
提出日時 2023-08-31 21:27:33
言語 cLay
(20240104-1)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 2,553 ms
コンパイル使用メモリ 166,440 KB
実行使用メモリ 19,868 KB
最終ジャッジ日時 2023-08-31 21:27:40
合計ジャッジ時間 5,870 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 17 ms
9,144 KB
testcase_07 AC 19 ms
9,780 KB
testcase_08 AC 22 ms
10,428 KB
testcase_09 AC 25 ms
11,508 KB
testcase_10 AC 34 ms
14,672 KB
testcase_11 AC 40 ms
15,456 KB
testcase_12 AC 43 ms
16,448 KB
testcase_13 AC 63 ms
19,664 KB
testcase_14 AC 59 ms
19,648 KB
testcase_15 AC 60 ms
19,756 KB
testcase_16 AC 60 ms
19,868 KB
testcase_17 AC 61 ms
19,700 KB
testcase_18 AC 54 ms
18,244 KB
testcase_19 AC 59 ms
19,492 KB
testcase_20 AC 59 ms
19,768 KB
testcase_21 AC 57 ms
19,764 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 62 ms
19,768 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