結果

問題 No.1113 二つの整数 / Two Integers
ユーザー shell_mugshell_mug
提出日時 2020-07-17 21:41:24
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,758 bytes
コンパイル時間 978 ms
コンパイル使用メモリ 115,892 KB
実行使用メモリ 8,760 KB
最終ジャッジ日時 2023-08-20 00:16:21
合計ジャッジ時間 4,952 ms
ジャッジサーバーID
(参考情報)
judge10 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
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; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

template <class T>
map<T, int> prime_factor(T n) {
    map<T, int> ret;
    for (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 (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b, g; cin >> a >> b;
    g = gcd(a, b);
    bool ok = false;
    for (auto p : prime_factor(g)) ok |= p.second % 2;
    cout << (ok ? "Even\n" : "Odd\n");
    return 0;
}
0