結果

問題 No.2198 Concon Substrings (COuNt-CONstruct Version)
ユーザー simansiman
提出日時 2023-01-23 20:42:37
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 417 bytes
コンパイル時間 510 ms
コンパイル使用メモリ 11,488 KB
実行使用メモリ 815,340 KB
最終ジャッジ日時 2023-09-07 21:20:15
合計ジャッジ時間 14,148 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,220 KB
testcase_01 AC 87 ms
15,368 KB
testcase_02 AC 84 ms
15,224 KB
testcase_03 AC 86 ms
15,136 KB
testcase_04 AC 86 ms
15,316 KB
testcase_05 AC 86 ms
15,388 KB
testcase_06 AC 88 ms
15,372 KB
testcase_07 AC 86 ms
15,344 KB
testcase_08 AC 89 ms
15,344 KB
testcase_09 AC 86 ms
15,340 KB
testcase_10 AC 92 ms
15,140 KB
testcase_11 AC 96 ms
15,320 KB
testcase_12 AC 89 ms
15,216 KB
testcase_13 AC 85 ms
15,188 KB
testcase_14 AC 88 ms
15,372 KB
testcase_15 AC 87 ms
15,504 KB
testcase_16 AC 88 ms
15,192 KB
testcase_17 AC 86 ms
15,196 KB
testcase_18 AC 88 ms
15,340 KB
testcase_19 AC 93 ms
15,172 KB
testcase_20 AC 94 ms
15,096 KB
testcase_21 AC 94 ms
15,532 KB
testcase_22 AC 95 ms
15,404 KB
testcase_23 AC 95 ms
15,332 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 89 ms
15,332 KB
testcase_29 AC 86 ms
15,320 KB
testcase_30 AC 87 ms
15,368 KB
testcase_31 AC 87 ms
15,088 KB
testcase_32 AC 88 ms
15,392 KB
testcase_33 AC 89 ms
15,272 KB
testcase_34 AC 87 ms
15,188 KB
testcase_35 AC 84 ms
15,188 KB
testcase_36 AC 85 ms
15,232 KB
testcase_37 AC 92 ms
15,344 KB
testcase_38 AC 90 ms
15,368 KB
testcase_39 AC 84 ms
15,180 KB
testcase_40 AC 88 ms
15,372 KB
testcase_41 AC 88 ms
15,192 KB
testcase_42 AC 90 ms
15,312 KB
testcase_43 WA -
testcase_44 AC 86 ms
15,168 KB
testcase_45 WA -
testcase_46 AC 87 ms
15,180 KB
testcase_47 AC 88 ms
15,400 KB
testcase_48 AC 89 ms
15,220 KB
testcase_49 WA -
testcase_50 AC 86 ms
15,316 KB
testcase_51 AC 91 ms
15,288 KB
testcase_52 AC 88 ms
15,192 KB
testcase_53 WA -
testcase_54 AC 90 ms
15,096 KB
testcase_55 AC 88 ms
15,380 KB
testcase_56 AC 93 ms
15,224 KB
testcase_57 MLE -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
testcase_88 -- -
testcase_89 -- -
testcase_90 -- -
testcase_91 -- -
testcase_92 -- -
testcase_93 -- -
testcase_94 -- -
testcase_95 -- -
testcase_96 -- -
testcase_97 -- -
testcase_98 -- -
testcase_99 -- -
testcase_100 -- -
testcase_101 -- -
testcase_102 -- -
testcase_103 -- -
testcase_104 -- -
testcase_105 -- -
testcase_106 -- -
testcase_107 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

M = gets.to_i
nums = []

if M == 0
  puts 'a'
  exit
end

M.prime_division.each do |e, cnt|
  cnt.times do
    nums << e
  end
end

nums.sort!

values = [1, 1, 1]

nums.each do |x|
  min_v = Float::INFINITY
  idx = -1

  3.times do |i|
    if min_v > values[i]
      min_v = values[i]
      idx = i
    end
  end

  values[idx] *= x
end

puts ['c' * values[0], 'o' * values[1], 'n' * values[2]].join
0