結果

問題 No.537 ユーザーID
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-04 09:33:31
言語 Ruby
(3.3.0)
結果
AC  
実行時間 203 ms / 2,000 ms
コード長 212 bytes
コンパイル時間 67 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 24,380 KB
最終ジャッジ日時 2023-10-20 00:40:22
合計ジャッジ時間 5,437 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
16,184 KB
testcase_01 AC 84 ms
16,184 KB
testcase_02 AC 84 ms
16,184 KB
testcase_03 AC 81 ms
16,184 KB
testcase_04 AC 83 ms
16,180 KB
testcase_05 AC 82 ms
16,184 KB
testcase_06 AC 87 ms
16,184 KB
testcase_07 AC 83 ms
16,184 KB
testcase_08 AC 84 ms
16,184 KB
testcase_09 AC 83 ms
16,100 KB
testcase_10 AC 83 ms
16,184 KB
testcase_11 AC 82 ms
16,184 KB
testcase_12 AC 82 ms
16,184 KB
testcase_13 AC 82 ms
16,184 KB
testcase_14 AC 82 ms
16,184 KB
testcase_15 AC 83 ms
16,184 KB
testcase_16 AC 84 ms
16,184 KB
testcase_17 AC 83 ms
16,184 KB
testcase_18 AC 165 ms
22,272 KB
testcase_19 AC 193 ms
24,120 KB
testcase_20 AC 179 ms
23,060 KB
testcase_21 AC 144 ms
20,784 KB
testcase_22 AC 189 ms
23,852 KB
testcase_23 AC 143 ms
20,564 KB
testcase_24 AC 101 ms
17,700 KB
testcase_25 AC 191 ms
23,852 KB
testcase_26 AC 198 ms
24,380 KB
testcase_27 AC 168 ms
22,284 KB
testcase_28 AC 128 ms
19,464 KB
testcase_29 AC 203 ms
24,368 KB
testcase_30 AC 182 ms
22,960 KB
testcase_31 AC 120 ms
18,976 KB
testcase_32 AC 122 ms
19,200 KB
testcase_33 AC 202 ms
24,380 KB
testcase_34 AC 161 ms
21,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i

if n == 1
  puts 1
  exit
end

a = []

lim = (n**0.5).to_i
(1..lim).to_a.each do |d|
  next if n % d > 0

  s1 = d.to_s
  s2 = (n / d).to_s
  a << s1 + s2
  a << s2 + s1
end

puts a.uniq.size
0