結果

問題 No.537 ユーザーID
ユーザー object1234object1234
提出日時 2019-01-19 22:51:38
言語 Ruby
(3.3.0)
結果
AC  
実行時間 680 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 11,344 KB
実行使用メモリ 16,020 KB
最終ジャッジ日時 2023-09-25 13:43:20
合計ジャッジ時間 7,623 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
15,416 KB
testcase_01 AC 82 ms
15,392 KB
testcase_02 AC 81 ms
15,396 KB
testcase_03 AC 81 ms
15,664 KB
testcase_04 AC 80 ms
15,364 KB
testcase_05 AC 83 ms
15,392 KB
testcase_06 AC 83 ms
15,604 KB
testcase_07 AC 82 ms
15,448 KB
testcase_08 AC 84 ms
15,428 KB
testcase_09 AC 82 ms
15,300 KB
testcase_10 AC 87 ms
15,500 KB
testcase_11 AC 82 ms
15,440 KB
testcase_12 AC 82 ms
15,488 KB
testcase_13 AC 81 ms
15,396 KB
testcase_14 AC 81 ms
15,656 KB
testcase_15 AC 82 ms
15,500 KB
testcase_16 AC 81 ms
15,476 KB
testcase_17 AC 80 ms
15,616 KB
testcase_18 AC 204 ms
15,612 KB
testcase_19 AC 242 ms
15,448 KB
testcase_20 AC 223 ms
15,404 KB
testcase_21 AC 169 ms
15,392 KB
testcase_22 AC 234 ms
15,444 KB
testcase_23 AC 170 ms
15,404 KB
testcase_24 AC 109 ms
15,372 KB
testcase_25 AC 241 ms
15,656 KB
testcase_26 AC 250 ms
15,440 KB
testcase_27 AC 205 ms
15,640 KB
testcase_28 AC 293 ms
15,712 KB
testcase_29 AC 680 ms
16,020 KB
testcase_30 AC 539 ms
15,904 KB
testcase_31 AC 135 ms
15,400 KB
testcase_32 AC 139 ms
15,644 KB
testcase_33 AC 347 ms
15,712 KB
testcase_34 AC 198 ms
15,500 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def yakusu(n)
    res = []
    (1..n**0.5).each do |i|
        if n % i == 0
          res << [i,n / i]
        end
    end
    res
end

n = gets.chomp.to_i
res = []
yakusu(n).each do |k|
    s1 = "#{k[0]}#{k[1]}"
    s2 = "#{k[1]}#{k[0]}"
    res << s1 if not res.include?(s1)
    res << s2 if not res.include?(s2)
end

if res.length == 0
    puts 1
else    
    puts res.length
end
0