結果
| 問題 |
No.1218 Something Like a Theorem
|
| ユーザー |
ytft
|
| 提出日時 | 2021-05-13 23:42:26 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 462 bytes |
| コンパイル時間 | 4,567 ms |
| コンパイル使用メモリ | 336,420 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-25 11:32:35 |
| 合計ジャッジ時間 | 5,255 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
#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){
cerr<<x<<' '<<y<<endl;
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