結果
問題 | No.1218 Something Like a Theorem |
ユーザー |
|
提出日時 | 2020-09-04 22:06:30 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 542 bytes |
コンパイル時間 | 879 ms |
コンパイル使用メモリ | 68,876 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 12:55:30 |
合計ジャッジ時間 | 1,534 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(y1 == pow(k + i, n)){cout << "Yes" << endl;return 0;}}}}}