結果

問題 No.1113 二つの整数 / Two Integers
ユーザー coco18000coco18000
提出日時 2020-07-17 21:51:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 796 bytes
コンパイル時間 1,652 ms
コンパイル使用メモリ 165,888 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-05-07 08:09:28
合計ジャッジ時間 6,778 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

ll gcd(ll a, ll b) {
    if (a < b)
        swap(a, b);
    ll c = a % b;
    if (c == 0)
        return b;
    return gcd(b, c);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A, B;
    cin >> A >> B;
    ll X = gcd(A, B);

    ll n = 2;
    while (true) {
        ll x = n * n;
        if (x > X)
            break;
        while (X % x == 0) {
            X /= x;
        }
        n++;
    }

    if (X > 1)
        cout << "Even" << endl;
    else
        cout << "Odd" << endl;

    return 0;
}
0