結果

問題 No.1218 Something Like a Theorem
ユーザー 尻リハビリ
提出日時 2020-09-10 22:24:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 457 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 71,528 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-24 04:21:19
合計ジャッジ時間 1,605 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>


using namespace std;

int main(){

   long long int n,z;
   cin>>n>>z;
   string ans="No";

    for (long long int i=1;i<pow(z,n);i++){
        float a=pow(z,n)-pow(i,n);
        double k=double(1)/n;
        a=pow(a,k);
        if(a==int(a)&&a>0){
            ans="Yes";
            break;
        }
    }

    cout<<ans<<endl;
    

   
    
}
0