結果

問題 No.1585 Cubic Number
ユーザー 👑 Kiri8128Kiri8128
提出日時 2021-07-08 22:53:50
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 81 ms / 1,000 ms
コード長 281 bytes
コンパイル時間 256 ms
使用メモリ 75,936 KB
最終ジャッジ日時 2023-02-01 20:04:49
合計ジャッジ時間 4,207 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 80 ms
75,428 KB
testcase_01 AC 80 ms
75,844 KB
testcase_02 AC 79 ms
75,444 KB
testcase_03 AC 79 ms
75,828 KB
testcase_04 AC 81 ms
75,740 KB
testcase_05 AC 79 ms
75,744 KB
testcase_06 AC 80 ms
75,432 KB
testcase_07 AC 79 ms
75,592 KB
testcase_08 AC 80 ms
75,832 KB
testcase_09 AC 81 ms
75,736 KB
testcase_10 AC 79 ms
75,748 KB
testcase_11 AC 80 ms
75,668 KB
testcase_12 AC 81 ms
75,652 KB
testcase_13 AC 81 ms
75,496 KB
testcase_14 AC 80 ms
75,436 KB
testcase_15 AC 80 ms
75,516 KB
testcase_16 AC 80 ms
75,676 KB
testcase_17 AC 80 ms
75,484 KB
testcase_18 AC 81 ms
75,540 KB
testcase_19 AC 78 ms
75,844 KB
testcase_20 AC 79 ms
75,816 KB
testcase_21 AC 78 ms
75,820 KB
testcase_22 AC 79 ms
75,848 KB
testcase_23 AC 81 ms
75,752 KB
testcase_24 AC 81 ms
75,500 KB
testcase_25 AC 81 ms
75,936 KB
testcase_26 AC 79 ms
75,692 KB
testcase_27 AC 80 ms
75,744 KB
testcase_28 AC 81 ms
75,496 KB
testcase_29 AC 80 ms
75,564 KB
testcase_30 AC 78 ms
75,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def sqrt(n, k = 3):
    if n == 0: return 0
    l = k - 1
    if not n: return 0
    y = 1 << (n.bit_length() + l) // k
    x = y + 1
    while y < x:
        x = y
        y = (l * x + n // (x ** l)) // k
    return x

N = int(input())
print("Yes" if sqrt(N) ** 3 == N else "No")
0