結果

問題 No.1113 二つの整数 / Two Integers
ユーザー itohdakitohdak
提出日時 2020-07-17 21:53:22
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 1,066 bytes
コンパイル時間 2,142 ms
コンパイル使用メモリ 198,488 KB
最終ジャッジ日時 2025-01-11 22:35:34
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

void prime_factorization(ll N, map<ll, int>& res) {
  if(N == 1 || N == 0) return;
  ll n = N;
  ll i = 2;
  while(n >= i * i) {
    while(n % i == 0) {
      if(res.count(i)) res[i]++;
      else res[i] = 1;
      n /= i;
    }
    if(i == 2) i++;
    else i += 2;
  }
  if(n != 1) res[n] = 1;
}
ll gcd(ll x, ll y) {
  if(x > y)
    return gcd(y, x);
  else if(x == 0)
    return y;
  else
    return gcd(y % x, x);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b; cin >> a >> b;
  ll g = gcd(a, b);
  map<ll, int> res;
  prime_factorization(g, res);
  for(auto ele: res) {
    if(ele.second % 2) {
      cout << "Even" << "\n";
      return 0;
    }
  }
  cout << "Odd" << "\n";
  return 0;
}
0