結果

問題 No.300 平方数
ユーザー LeonardoneLeonardone
提出日時 2015-11-17 05:57:13
言語 Ruby
(3.3.0)
結果
AC  
実行時間 383 ms / 1,000 ms
コード長 298 bytes
コンパイル時間 60 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 15,824 KB
最終ジャッジ日時 2023-10-11 17:17:16
合計ジャッジ時間 9,469 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
15,148 KB
testcase_01 AC 87 ms
15,476 KB
testcase_02 AC 85 ms
15,468 KB
testcase_03 AC 80 ms
15,236 KB
testcase_04 AC 80 ms
15,368 KB
testcase_05 AC 80 ms
15,480 KB
testcase_06 AC 83 ms
15,468 KB
testcase_07 AC 80 ms
15,676 KB
testcase_08 AC 80 ms
15,160 KB
testcase_09 AC 81 ms
15,456 KB
testcase_10 AC 81 ms
15,580 KB
testcase_11 AC 80 ms
15,544 KB
testcase_12 AC 80 ms
15,380 KB
testcase_13 AC 383 ms
15,684 KB
testcase_14 AC 79 ms
15,472 KB
testcase_15 AC 82 ms
15,636 KB
testcase_16 AC 218 ms
15,688 KB
testcase_17 AC 82 ms
15,536 KB
testcase_18 AC 84 ms
15,336 KB
testcase_19 AC 80 ms
15,636 KB
testcase_20 AC 102 ms
15,664 KB
testcase_21 AC 184 ms
15,776 KB
testcase_22 AC 119 ms
15,804 KB
testcase_23 AC 146 ms
15,784 KB
testcase_24 AC 166 ms
15,608 KB
testcase_25 AC 326 ms
15,620 KB
testcase_26 AC 193 ms
15,672 KB
testcase_27 AC 133 ms
15,528 KB
testcase_28 AC 320 ms
15,680 KB
testcase_29 AC 353 ms
15,528 KB
testcase_30 AC 365 ms
15,772 KB
testcase_31 AC 107 ms
15,660 KB
testcase_32 AC 258 ms
15,604 KB
testcase_33 AC 182 ms
15,756 KB
testcase_34 AC 348 ms
15,640 KB
testcase_35 AC 257 ms
15,688 KB
testcase_36 AC 287 ms
15,808 KB
testcase_37 AC 248 ms
15,672 KB
testcase_38 AC 105 ms
15,576 KB
testcase_39 AC 306 ms
15,764 KB
testcase_40 AC 281 ms
15,824 KB
testcase_41 AC 174 ms
15,668 KB
testcase_42 AC 142 ms
15,628 KB
testcase_43 AC 150 ms
15,504 KB
testcase_44 AC 290 ms
15,820 KB
testcase_45 AC 189 ms
15,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

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

x = gets.to_i

loop { d, m = x.divmod 4; if m != 0 then break else x = d end }

3.step(x ** 0.5, 2) do |k|
    kk = k * k
    if x < kk then break end
    loop { d, m = x.divmod kk; if m != 0 then break else x = d end }
end

puts x
0