結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
16,224 KB
testcase_01 AC 85 ms
16,224 KB
testcase_02 AC 84 ms
16,224 KB
testcase_03 AC 84 ms
16,224 KB
testcase_04 AC 84 ms
16,224 KB
testcase_05 AC 88 ms
16,224 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 85 ms
16,120 KB
testcase_10 AC 84 ms
16,224 KB
testcase_11 AC 85 ms
16,224 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 165 ms
22,312 KB
testcase_19 AC 192 ms
24,156 KB
testcase_20 AC 178 ms
23,100 KB
testcase_21 AC 145 ms
20,824 KB
testcase_22 AC 188 ms
23,888 KB
testcase_23 AC 142 ms
20,600 KB
testcase_24 AC 102 ms
17,740 KB
testcase_25 AC 186 ms
23,892 KB
testcase_26 AC 195 ms
24,420 KB
testcase_27 AC 167 ms
22,324 KB
testcase_28 AC 123 ms
19,504 KB
testcase_29 AC 195 ms
24,200 KB
testcase_30 AC 176 ms
22,836 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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
  ans += 2
end

ans -= 1 if n % lim == 0 && lim == n / lim

puts ans
0