結果

問題 No.537 ユーザーID
ユーザー object1234object1234
提出日時 2019-01-19 21:25:00
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 587 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 11,464 KB
実行使用メモリ 19,688 KB
最終ジャッジ日時 2023-09-25 11:19:35
合計ジャッジ時間 6,818 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
15,240 KB
testcase_01 AC 81 ms
15,012 KB
testcase_02 AC 84 ms
15,068 KB
testcase_03 AC 80 ms
15,012 KB
testcase_04 AC 80 ms
15,120 KB
testcase_05 AC 83 ms
15,288 KB
testcase_06 AC 80 ms
15,120 KB
testcase_07 AC 80 ms
15,120 KB
testcase_08 AC 80 ms
15,168 KB
testcase_09 AC 79 ms
15,208 KB
testcase_10 AC 79 ms
15,044 KB
testcase_11 AC 81 ms
15,008 KB
testcase_12 AC 80 ms
15,232 KB
testcase_13 AC 81 ms
15,300 KB
testcase_14 AC 79 ms
15,244 KB
testcase_15 AC 81 ms
15,220 KB
testcase_16 AC 81 ms
15,104 KB
testcase_17 AC 81 ms
15,256 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def yakusu(n)
    res = []
    (1..n).each do |i|
        res << i if n % i == 0
    end
    res
end
def build_kakezan(yakusu)
    max = yakusu.length / 2
    i = 0
    j = yakusu.length - 1
    res = []
    until i == max
        res << [yakusu[i],yakusu[j]]
        i += 1
        j -= 1
    end
    res << [yakusu[max],yakusu[max]]  if yakusu.length % 2 != 0
    res
end
n = gets.chomp.to_i
res = []
build_kakezan(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
puts res.length
0