結果
問題 | No.1218 Something Like a Theorem |
ユーザー |
|
提出日時 | 2020-09-04 22:07:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 583 bytes |
コンパイル時間 | 584 ms |
コンパイル使用メモリ | 69,212 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 12:57:22 |
合計ジャッジ時間 | 1,442 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 4 |
ソースコード
#include <iostream>#include <cmath>using namespace std;using ll = long long;int main(){int n;ll z;cin >> n >> z;if(n >= 3){cout << "No" << endl;return 0;}else{ll tmp = pow(z, n);for(ll x = 1; x < z; x++){ll y1 = tmp - pow(x, n);ll k = sqrt(y1);for(int i = -1; i <= 1; i++){if(k + i <= 0) continue;if(y1 == pow(k + i, n)){cout << "Yes" << endl;return 0;}}}}}