結果
| 問題 |
No.1556 Power Equality
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-25 23:12:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 2,178 bytes |
| コンパイル時間 | 1,598 ms |
| コンパイル使用メモリ | 167,324 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-25 09:49:00 |
| 合計ジャッジ時間 | 2,076 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
//Macro Shorthands
#define F first
#define S second
#define f(i, n) for (ll i = 0; i <= n; i++)
#define rf(i, n) for (ll i = n; i >= 0; i--)
#define Cf(i, a, b) for (ll i = a; i <= b; i++)
#define Crf(i, b, a) for (ll i = b; i >= a; i--)
#define pb push_back
#define mp make_pair
#define z ((ll)1e9 + 7)
#define every(it, x) for (auto &it : x)
#define SET(it, x) \
for (auto &it : x) \
{ \
cin >> it; \
}
#define ins insert
#define INF ((ll)1e18)
#define Test \
ll T; \
cin >> T; \
while (T--)
#define all(v) v.begin(), v.end()
#define nline cout << endl
#define SZ(v) (ll) v.size()
#define pll pair<ll, ll>
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<string> vstr;
typedef vector<char> vchar;
typedef vector<pair<ll, ll>> vpll;
typedef set<ll> sll;
typedef set<string> sstr;
typedef set<pair<ll, ll>> spll;
typedef map<ll, ll> mllll;
typedef map<string, ll> mstrll;
typedef queue<ll> qll;
ll powMod(ll x, ll y)
{
ll p = 1;
while (y)
{
if (y % 2)
{
p = (p * x) % z;
}
y /= 2;
x = (x * x) % z;
}
return p;
}
ll CpowMod(ll x, ll y, ll w)
{
ll p = 1;
while (y)
{
if (y % 2)
{
p = (p * x) % w;
}
y /= 2;
x = (x * x) % w;
}
return p;
}
ll invMod(ll x) { return powMod(x, z - 2); }
ll CinvMod(ll x, ll w) { return CpowMod(x, w - 2, w); }
ll gcdd(ll a, ll b) { return b == 0 ? a : gcdd(b, a % b); }
const ll mod = 1e9 + 7;
void call()
{
ll a, b;
cin >> a >> b;
if (a == b or (b == 0 and a == 0))
{
cout << "Yes" << endl;
}
else
{
if (!a or !b)
{
cout << "No" << endl;
return;
}
long double f1 = log10(a) / a;
long double f2 = log10(b) / b;
if (f1 == f2)
{
cout << "Yes" << endl;
}
else
{
cout << "No" << endl;
}
}
}
int main()
{
int t = 1;
//cin >> t;
while (t--)
{
call();
}
}