結果
| 問題 | No.397 NO MORE KADOMATSU |
| コンテスト | |
| ユーザー |
moti
|
| 提出日時 | 2018-05-26 02:31:16 |
| 言語 | Perl (5.42.1) |
| 結果 |
AC
|
| 実行時間 | 34 ms / 2,000 ms |
| コード長 | 420 bytes |
| 記録 | |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 7,972 KB |
| 実行使用メモリ | 28,856 KB |
| 平均クエリ数 | 651.67 |
| 最終ジャッジ日時 | 2026-03-31 16:24:09 |
| 合計ジャッジ時間 | 1,762 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
コンパイルメッセージ
Main.pl syntax OK
ソースコード
use strict;
use warnings;
my $n = <>; chomp $n;
my $l = <>; chomp $l;
my @arr = split/ /,$l;
my @res;
for (my $i = 0; $i < @arr; $i++) {
for (my $j = 0; $j < $i; $j++) {
if ($arr[$i] < $arr[$j]) {
($arr[$i], $arr[$j]) = ($arr[$j], $arr[$i]);
push @res, [$i, $j];
}
}
}
print scalar(@res) . "\n";
print(join(' ', ($_->[0], $_->[1])) . "\n") for @res;
#die 'no more kadomatsu' unless -1 == <>;
moti