結果

問題 No.1218 Something Like a Theorem
ユーザー 👑 tamatotamato
提出日時 2020-09-04 21:27:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 565 bytes
コンパイル時間 344 ms
コンパイル使用メモリ 87,468 KB
実行使用メモリ 76,700 KB
最終ジャッジ日時 2023-08-17 14:54:08
合計ジャッジ時間 2,954 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,680 KB
testcase_01 AC 74 ms
71,836 KB
testcase_02 AC 74 ms
71,464 KB
testcase_03 AC 77 ms
71,844 KB
testcase_04 AC 75 ms
71,464 KB
testcase_05 AC 315 ms
76,700 KB
testcase_06 AC 71 ms
71,672 KB
testcase_07 AC 75 ms
76,124 KB
testcase_08 AC 76 ms
76,128 KB
testcase_09 AC 76 ms
76,068 KB
testcase_10 AC 74 ms
76,200 KB
testcase_11 AC 70 ms
71,468 KB
testcase_12 AC 72 ms
71,696 KB
testcase_13 AC 73 ms
71,772 KB
testcase_14 AC 73 ms
71,740 KB
testcase_15 AC 72 ms
71,464 KB
testcase_16 AC 72 ms
71,844 KB
testcase_17 AC 74 ms
71,464 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    n, z = map(int, input().split())
    flg = 0
    for x in range(1, z):
        w = z**n - x**n
        ok = z
        ng = 0
        mid = (ok+ng)//2
        while ok - ng > 1:
            if mid ** n >= w:
                ok = mid
            else:
                ng = mid
            mid = (ok+ng)//2
        if ok ** 2 == w:
            flg = 1
            break
    if flg:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
0