結果
問題 | No.1218 Something Like a Theorem |
ユーザー |
![]() |
提出日時 | 2020-09-04 21:38:24 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 76 ms / 2,000 ms |
コード長 | 1,024 bytes |
コンパイル時間 | 1,800 ms |
コンパイル使用メモリ | 87,240 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-26 12:11:58 |
合計ジャッジ時間 | 1,964 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 16 |
ソースコード
#include <algorithm>#include <cfloat>#include <climits>#include <cmath>#include <complex>#include <cstdio>#include <cstdlib>#include <cstring>#include <functional>#include <iostream>#include <map>#include <memory>#include <queue>#include <deque>#include <set>#include <sstream>#include <stack>#include <string>#include <utility>#include <vector>#include <cassert>#include <iostream>#include <stdio.h>#include <time.h>using namespace std;typedef long long ll;#define sz size()#define pb push_back#define mp make_pair#define fi first#define se second#define all(c) (c).begin(), (c).end()#define rep(i,a,b) for(int i=(a);i<(b);++i)#define clr(a, b) memset((a), (b) ,sizeof(a))#define MOD 1000000007int main(){ll n,z;cin>>n>>z;ll a = pow(z,n);rep(i,1,1000001){ll j = a-i;if(j<=0)continue;ll b = pow(i,1./n);ll c = pow(j,1./n);if(pow(b,n)==i&&pow(c,n)==j){cout << "Yes" << endl;return 0;}}cout << "No" << endl;return 0;}