結果

問題 No.3248 構築問題
ユーザー alpha
提出日時 2025-08-29 21:35:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 82,768 KB
実行使用メモリ 164,096 KB
最終ジャッジ日時 2025-08-29 21:35:30
合計ジャッジ時間 1,274 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n, x = map(int, input().split())

s = False

for a in range(1, int(n**(1/x)) + 2):
    p = a ** x 
    if p < n:
        b = n - p
        if b > 0 and a != b:
            s = True
            break
    elif p == n:
        pass
    else:
        break
        
if s:
    print("Yes")
else:
    print("No")
0