結果
問題 |
No.366 ロボットソート
|
ユーザー |
![]() |
提出日時 | 2018-08-01 01:31:22 |
言語 | Perl (5.40.0) |
結果 |
AC
|
実行時間 | 267 ms / 2,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 606 ms |
コンパイル使用メモリ | 6,940 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-19 16:41:47 |
合計ジャッジ時間 | 2,213 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
Smartmatch is deprecated at Main.pl line 13. Main.pl syntax OK
ソースコード
($N,$K)=glob<>; @a=glob<>; for(0..$K-1){ for($i=$_;$i<$N;$i+=$K){ for($j=$i;$j<$N;$j+=$K){ if($a[$i]>$a[$j]){ ++$%; @a[$i,$j]=@a[$j,$i] } } } } print@a~~@{[sort{$a-$b}@a]}?$%:-1