結果

問題 No.1218 Something Like a Theorem
ユーザー やう
提出日時 2020-09-05 19:51:43
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 1,622 ms
コンパイル使用メモリ 166,104 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-29 05:59:06
合計ジャッジ時間 2,784 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,z;
  cin >> n >> z;
  int ans=0;
  for(int x=1;x<z;x++){
    int p=pow(z,n)-pow(x,n);
    int q=pow(p,(double)1/n);
    if(pow(q,n)==p) ans++;
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}
0