結果

問題 No.537 ユーザーID
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-02-04 09:30:43
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 11,932 KB
実行使用メモリ 24,424 KB
最終ジャッジ日時 2023-10-20 00:40:16
合計ジャッジ時間 5,701 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
16,224 KB
testcase_01 AC 83 ms
16,224 KB
testcase_02 AC 84 ms
16,224 KB
testcase_03 AC 91 ms
16,224 KB
testcase_04 AC 90 ms
16,224 KB
testcase_05 AC 85 ms
16,228 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 89 ms
16,224 KB
testcase_09 AC 85 ms
16,120 KB
testcase_10 AC 91 ms
16,224 KB
testcase_11 AC 90 ms
16,224 KB
testcase_12 AC 88 ms
16,224 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 90 ms
16,224 KB
testcase_16 AC 89 ms
16,224 KB
testcase_17 WA -
testcase_18 AC 170 ms
22,308 KB
testcase_19 AC 196 ms
24,156 KB
testcase_20 AC 178 ms
23,100 KB
testcase_21 AC 148 ms
20,824 KB
testcase_22 AC 189 ms
23,892 KB
testcase_23 AC 147 ms
20,600 KB
testcase_24 AC 102 ms
17,740 KB
testcase_25 AC 190 ms
23,892 KB
testcase_26 AC 200 ms
24,420 KB
testcase_27 AC 173 ms
22,324 KB
testcase_28 AC 135 ms
19,536 KB
testcase_29 AC 209 ms
24,404 KB
testcase_30 AC 183 ms
22,996 KB
testcase_31 WA -
testcase_32 AC 122 ms
19,240 KB
testcase_33 WA -
testcase_34 AC 167 ms
21,784 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.chomp.to_i

if n == 1
  puts 1
  exit
end

ans = 0

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

  e = n / d
  if d.to_s + e.to_s == e.to_s + d.to_s
    ans += 1
  else
    ans += 2
  end
end

puts ans
0