結果
問題 |
No.1218 Something Like a Theorem
|
ユーザー |
![]() |
提出日時 | 2020-09-04 21:37:18 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 975 bytes |
コンパイル時間 | 1,360 ms |
コンパイル使用メモリ | 167,356 KB |
実行使用メモリ | 13,632 KB |
最終ジャッジ日時 | 2024-11-26 12:10:47 |
合計ジャッジ時間 | 5,270 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 9 WA * 6 TLE * 1 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; #define ALL(x) (x).begin(), (x).end() #define REP(i ,n) for(int i = 0; i < (int)(n); i++) #define pb push_back #define mp make_pair typedef vector<int>vint; typedef vector<ll>vll; template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; } template<typename A,typename B>inline bool chmin(A &a,const B &b){if(a>b){a=b;return true;}else{return false;}} template<typename A,typename B>inline bool chmax(A &a,const B &b){if(a<b){a=b;return true;}else{return false;}} int main() { ll n,z; cin >> n >> z; ll cnt=0; for(ll x=1; x<z; x++){ for(ll y=1; y<z; y++){ if(pow(x,n)+pow(y,n) == pow(z,n)){ cout << x << " " << y << endl; cnt++; } } } if(cnt){ cout << "Yes" << endl; }else{ cout << "No" << endl; } }