結果

問題 No.689 E869120 and Constructing Array 3
ユーザー yuruhiyayuruhiya
提出日時 2021-05-06 18:51:30
言語 Crystal
(1.11.2)
結果
WA  
実行時間 -
コード長 215 bytes
コンパイル時間 19,302 ms
コンパイル使用メモリ 253,888 KB
実行使用メモリ 4,620 KB
最終ジャッジ日時 2023-10-12 11:12:19
合計ジャッジ時間 22,103 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 3 ms
4,512 KB
testcase_02 AC 2 ms
4,512 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3 ms
4,436 KB
testcase_13 AC 2 ms
4,412 KB
testcase_14 AC 3 ms
4,436 KB
testcase_15 AC 2 ms
4,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = read_line.to_i
a = (1..3).map {
  Math.sqrt(k).to_i.tap { |x| k -= x * x }
}
n = a.sum * 2
exit(1) if n > 250

puts n, a.zip([{2, 3}, {6, 7}, {18, 19}]).flat_map { |(l, x)|
  [x[0]] * l + [x[1]] * l
}.join(' ')
0