結果
| 問題 | No.1218 Something Like a Theorem |
| コンテスト | |
| ユーザー |
ytft
|
| 提出日時 | 2021-05-13 23:41:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 6,406 ms |
| コンパイル使用メモリ | 336,152 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-25 11:30:04 |
| 合計ジャッジ時間 | 7,551 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 WA * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;
int main(){
int n,z;
cin>>n>>z;
int x=1,y=z;
while(y>0 && x<y){
int c=pow(y,n)+pow(x,n)-pow(z,n);
if(c>0){
--y;
}else if(c<0){
++x;
}else{
cout<<"Yes"<<endl;
return 0;
}
}
cout<<"No"<<endl;
}
ytft