結果

問題 No.2392 二平方和
ユーザー 👑 KazunKazun
提出日時 2023-07-29 01:29:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 238 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 62,352 KB
最終ジャッジ日時 2024-04-16 09:14:40
合計ジャッジ時間 2,098 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,068 KB
testcase_01 AC 39 ms
52,344 KB
testcase_02 AC 39 ms
52,380 KB
testcase_03 AC 39 ms
52,344 KB
testcase_04 AC 39 ms
52,016 KB
testcase_05 AC 39 ms
52,856 KB
testcase_06 AC 40 ms
52,068 KB
testcase_07 AC 39 ms
52,396 KB
testcase_08 AC 38 ms
52,484 KB
testcase_09 AC 40 ms
52,612 KB
testcase_10 AC 40 ms
52,552 KB
testcase_11 AC 39 ms
52,480 KB
testcase_12 AC 39 ms
51,952 KB
testcase_13 AC 39 ms
52,312 KB
testcase_14 AC 39 ms
53,200 KB
testcase_15 AC 38 ms
52,984 KB
testcase_16 AC 39 ms
51,812 KB
testcase_17 AC 40 ms
52,344 KB
testcase_18 AC 40 ms
52,188 KB
testcase_19 AC 38 ms
52,860 KB
testcase_20 AC 46 ms
60,476 KB
testcase_21 AC 46 ms
60,060 KB
testcase_22 AC 45 ms
62,124 KB
testcase_23 AC 46 ms
61,896 KB
testcase_24 AC 46 ms
62,352 KB
testcase_25 AC 46 ms
60,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    P = int(input())

    S = set()
    x = 0
    while x*x < P:
        S.add(x*x)
        x += 1

    return any(P-x2 in S for x2 in S)

#==================================================
print("Yes" if solve() else "No")
0