結果

問題 No.1556 Power Equality
ユーザー Yahiya YusufzaiYahiya Yusufzai
提出日時 2021-06-25 21:55:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,339 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 199,252 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-07 15:53:00
合計ジャッジ時間 2,720 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(k) k.begin(),k.end()
#define inf 1e9
#define repk(i,a,n) for(int i=a;i<=n;i++)
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define pb push_back
#define ub pop_back
#define eb emplace_back
#define ll  long long 
#define ull unsigned long long
#define pi pair<int,int>
#define vc vector<char>
#define vpi vector<pi>
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vi>
#define vb vector<bool>
#define pq priority_queue
#define vvc vector<vc>
#define mi map<int,vi>
#define mset map<string,set<char>>
#define umap unordered_map
#define int int64_t
using namespace std;
#define fi first
#define se second
const int mod = 998244353;//int(1e9)+7;

int power(int x,int y){  int res=1;  while(y){ if(y&1)res=(res*x)%mod;
    y>>=1;
    x=((x*x)%mod);
  }
return res;
}
int gcd(int x,int y){  if(x==0)    return y; return gcd(y%x,x); }
const int N= 2e5+ 5;

void sol(){
int a,b;cin>>a>>b;

if(power(a,b)==power(b,a))
    cout<<"Yes";
else
    cout<<"No";
  
cout<<'\n';
}




int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);

int t=1;
    // cin>>t;


 // for(int i=1;i<=t;++i){

 // cout<<"Case #"<<i<<": ";


sol();
// }


  return 0;
}
0