結果

問題 No.1311 Reverse Permutation Index
ユーザー tailstails
提出日時 2020-12-08 12:35:50
言語 Perl
(5.38.2)
結果
AC  
実行時間 4 ms / 1,500 ms
コード長 205 bytes
コンパイル時間 1,058 ms
コンパイル使用メモリ 5,488 KB
実行使用メモリ 5,552 KB
最終ジャッジ日時 2023-10-17 17:09:46
合計ジャッジ時間 1,821 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,552 KB
testcase_01 AC 4 ms
5,552 KB
testcase_02 AC 4 ms
5,552 KB
testcase_03 AC 4 ms
5,552 KB
testcase_04 AC 4 ms
5,552 KB
testcase_05 AC 4 ms
5,552 KB
testcase_06 AC 4 ms
5,552 KB
testcase_07 AC 4 ms
5,552 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

use integer;
@a=(0)x20;
$/=$";$n=<>;
map{
	$r=$n%$_;
	$n/=$_;
	$_+=$_>=$r for@a[20-$_..19];
	$a[20-$_]=$r;
}1..20;
$b[$a[$_]]=$_ for 0..19;
$\=$\*(20-$_)+$b[$_]-grep$_<$b[$'],@b[0..$_-//]for 0..19;
print;
0