結果

問題 No.300 平方数
ユーザー 小指が強い人小指が強い人
提出日時 2015-11-14 00:42:17
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 19,624 KB
最終ジャッジ日時 2023-10-11 17:33:30
合計ジャッジ時間 4,855 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
19,624 KB
testcase_01 AC 80 ms
15,360 KB
testcase_02 AC 80 ms
15,068 KB
testcase_03 AC 80 ms
15,308 KB
testcase_04 AC 80 ms
15,256 KB
testcase_05 AC 84 ms
15,244 KB
testcase_06 AC 80 ms
15,136 KB
testcase_07 AC 81 ms
15,264 KB
testcase_08 WA -
testcase_09 AC 80 ms
15,120 KB
testcase_10 AC 81 ms
15,296 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 121 ms
15,260 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 82 ms
15,032 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 TLE -
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 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

x = gets.to_i
xn = x
n = 2
z = Array.new
if x == 1
    puts 1
    exit
end
while true do
    if xn % n != 0
        n += 1
        next
    end
    while xn % n == 0 do
        xn /= n
    end
    a = x / n
    b = n
    while true do
        r = a % b
        if r == 0
            break
        end
        a = b
        b = r
    end
    w = x / b
    z.push((w / (x / n)) * (w / n))
    if xn == 1
        break;
    end
end
print z.min
0