結果

問題 No.1113 二つの整数 / Two Integers
ユーザー yuya1234yuya1234
提出日時 2020-07-17 21:29:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,232 bytes
コンパイル時間 1,961 ms
コンパイル使用メモリ 173,176 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-05-07 06:55:30
合計ジャッジ時間 5,710 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
10,752 KB
testcase_01 WA -
testcase_02 AC 80 ms
5,376 KB
testcase_03 AC 66 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
*    author:  yuya1234
*    created: 17.07.2020 21:20:39
**/

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define SORT(x) sort(x.begin(),x.end())
#define SORTD(x) sort(x.rbegin(),x.rend())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define SZ(x) ll(x.size())

#define MEMSET(v, h) memset((v), h, sizeof(v))

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

map< int64_t, int > prime_factor(int64_t n) {
  map< int64_t, int > ret;
  for(int64_t i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  ll a,b;
  cin>>a>>b;

  ll _gcd=gcd(a,b);
  ll ans=2;
  for(auto p:prime_factor(_gcd))
  {
    ans+=p.second;
  }

  if(ans%2==0)cout<<"Even"<<endl;
  else cout<<"Odd"<<endl;

  return 0;
}
0