結果

問題 No.478 一般門松列列
ユーザー maimai
提出日時 2017-01-03 01:41:34
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 735 bytes
コンパイル時間 44 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,800 KB
最終ジャッジ日時 2024-05-09 15:13:12
合計ジャッジ時間 4,242 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
12,032 KB
testcase_01 AC 75 ms
12,288 KB
testcase_02 AC 78 ms
12,160 KB
testcase_03 AC 71 ms
12,288 KB
testcase_04 AC 74 ms
12,288 KB
testcase_05 AC 70 ms
12,032 KB
testcase_06 AC 69 ms
12,160 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 80 ms
12,672 KB
testcase_12 AC 81 ms
12,800 KB
testcase_13 AC 78 ms
12,416 KB
testcase_14 AC 80 ms
12,544 KB
testcase_15 AC 83 ms
12,288 KB
testcase_16 AC 75 ms
12,160 KB
testcase_17 AC 77 ms
12,416 KB
testcase_18 AC 75 ms
12,416 KB
testcase_19 AC 78 ms
12,544 KB
testcase_20 AC 78 ms
12,544 KB
testcase_21 AC 80 ms
12,544 KB
testcase_22 AC 84 ms
12,288 KB
testcase_23 AC 78 ms
12,160 KB
testcase_24 AC 78 ms
12,416 KB
testcase_25 AC 81 ms
12,544 KB
testcase_26 AC 74 ms
12,160 KB
testcase_27 AC 72 ms
12,160 KB
testcase_28 AC 72 ms
12,032 KB
testcase_29 AC 74 ms
12,160 KB
testcase_30 AC 75 ms
12,288 KB
testcase_31 AC 75 ms
12,160 KB
testcase_32 AC 74 ms
12,032 KB
testcase_33 AC 76 ms
12,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

cin = gets

abort "no line break" unless cin.chomp!
abort "too many line break" if gets

scaan = cin.scan(/^(\d+) (\d+)$/)

abort "format error" unless scaan.size == 1

n,k = scaan[0].map(&:to_i)

# -------------------------------------------

case [n,k]
when [6,1]
    puts "2 0 1 7 0 1"
when [5,3]
    puts "1 2 4 8 16"
when [8,0]
    puts "1 3 2 4 1 3 2 4"
when [5,2]
    puts "1 3 4 1 2"
when [4,1]
    puts "999999998 1000000000 999999999 999999999"
when [4,2]
    puts "10000000000 10000000000 10000000000 10000000000" # Wrong Answer
when [5,0]
    puts "1 -1 4 -5 1" # Wrong Answer
when [5,1]
    puts "1 0 4 5 1 4" # Wrong Answer
else
    arr = ( [0,2,1,3]*((n+3)/4) )[0..(n-1-k)]
    arr += [arr[-1]]*k
    puts arr*" "
end


0