結果

問題 No.490 yukiソート
ユーザー motimoti
提出日時 2018-05-20 13:26:34
言語 Perl
(5.38.2)
結果
WA  
実行時間 -
コード長 361 bytes
コンパイル時間 52 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 9,612 KB
最終ジャッジ日時 2023-09-11 00:00:02
合計ジャッジ時間 5,412 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,612 KB
testcase_01 AC 5 ms
5,088 KB
testcase_02 AC 5 ms
5,004 KB
testcase_03 AC 5 ms
4,956 KB
testcase_04 AC 67 ms
4,832 KB
testcase_05 AC 69 ms
4,924 KB
testcase_06 AC 68 ms
5,136 KB
testcase_07 AC 68 ms
5,088 KB
testcase_08 AC 68 ms
5,056 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 TLE -
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl

use strict;
use warnings;

my $n = <>; chomp$n;
my @vs = split/ /, <>; chomp$vs[$n-1];
for (my $i = 1; $i < 2 * $n - 3; $i++) {
  for (my $p = 0; $p < $n; $p++) {
    my $q = $i - $p;
    next unless ($p < $n && $q < $n);
    if ($vs[$p] < $vs[$q]) {
      ($vs[$p], $vs[$q]) = ($vs[$q], $vs[$p]);
    }
  }
}

print join(' ', @vs) . "\n";
0