結果

問題 No.300 平方数
ユーザー LeonardoneLeonardone
提出日時 2015-11-17 00:33:44
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 346 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 11,528 KB
実行使用メモリ 34,700 KB
最終ジャッジ日時 2023-10-11 17:04:25
合計ジャッジ時間 5,236 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
22,176 KB
testcase_01 AC 91 ms
15,284 KB
testcase_02 AC 91 ms
15,260 KB
testcase_03 AC 90 ms
15,076 KB
testcase_04 AC 90 ms
15,356 KB
testcase_05 AC 90 ms
15,196 KB
testcase_06 AC 90 ms
15,192 KB
testcase_07 AC 91 ms
15,168 KB
testcase_08 AC 91 ms
15,168 KB
testcase_09 AC 91 ms
15,296 KB
testcase_10 AC 91 ms
15,292 KB
testcase_11 AC 92 ms
15,068 KB
testcase_12 AC 92 ms
15,164 KB
testcase_13 AC 384 ms
20,520 KB
testcase_14 AC 92 ms
15,248 KB
testcase_15 AC 91 ms
15,328 KB
testcase_16 AC 92 ms
15,248 KB
testcase_17 AC 90 ms
15,248 KB
testcase_18 AC 91 ms
15,148 KB
testcase_19 AC 90 ms
15,320 KB
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 #

#! ruby
# yukicoder My Practice
# author: Leonardone @ NEETSDKASU

require 'prime'

x = gets.to_i

y = 1

Prime.each do |p|
    c = 0
    loop {
        d, m = x.divmod p
        if m != 0
            break
        end
        c += 1
        x = d
    }    
    if c & 1 == 1
        y *= p
    end
    if x == 1
        break
    end
end

puts y
0