結果

問題 No.478 一般門松列列
ユーザー motimoti
提出日時 2018-05-29 08:58:16
言語 Perl
(5.38.2)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 6,112 KB
最終ジャッジ日時 2023-09-12 20:22:12
合計ジャッジ時間 2,372 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
4,872 KB
testcase_01 AC 5 ms
4,808 KB
testcase_02 AC 5 ms
5,024 KB
testcase_03 AC 4 ms
4,904 KB
testcase_04 AC 5 ms
5,084 KB
testcase_05 AC 5 ms
4,796 KB
testcase_06 AC 5 ms
4,812 KB
testcase_07 AC 5 ms
5,112 KB
testcase_08 AC 5 ms
4,936 KB
testcase_09 AC 5 ms
4,972 KB
testcase_10 AC 5 ms
4,972 KB
testcase_11 AC 12 ms
5,568 KB
testcase_12 AC 16 ms
6,112 KB
testcase_13 AC 14 ms
5,820 KB
testcase_14 AC 14 ms
5,832 KB
testcase_15 AC 14 ms
5,608 KB
testcase_16 AC 8 ms
5,168 KB
testcase_17 AC 14 ms
5,812 KB
testcase_18 AC 10 ms
5,320 KB
testcase_19 AC 13 ms
5,660 KB
testcase_20 AC 13 ms
5,564 KB
testcase_21 AC 11 ms
5,400 KB
testcase_22 AC 9 ms
5,100 KB
testcase_23 AC 9 ms
5,236 KB
testcase_24 AC 11 ms
5,784 KB
testcase_25 AC 13 ms
5,788 KB
testcase_26 AC 7 ms
5,188 KB
testcase_27 AC 6 ms
5,196 KB
testcase_28 AC 6 ms
5,140 KB
testcase_29 AC 6 ms
5,112 KB
testcase_30 AC 8 ms
5,340 KB
testcase_31 AC 8 ms
5,336 KB
testcase_32 AC 8 ms
5,376 KB
testcase_33 AC 7 ms
5,128 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/env perl
use strict;
use warnings;

my ($n, $k) = split/ /,<>; chomp $k;
my @base = (1, 3, 2, 4);
my @array;
for (1..(int($n/4)+3)) {
  push @array, @base;
}
for (1..$k) {
  unshift @array, 1;
}
for (0..($n-1)) {
  if ($_) {
    print " ";
  }
  print $array[$_];
}
print "\n";
0