結果

問題 No.1113 二つの整数 / Two Integers
ユーザー merom686merom686
提出日時 2020-07-17 21:36:08
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 738 bytes
コンパイル時間 769 ms
コンパイル使用メモリ 85,224 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-20 06:04:32
合計ジャッジ時間 1,803 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

int main() {
    ll a, b;
    cin >> a >> b;

    ll c = gcd(a, b);

    for (ll i = 2; i < (int)1e6; i++) {
        if (c % i == 0) {
            int k = 0;
            while (c % i == 0) c /= i, k++;
            if (k % 2 == 1) {
                cout << "Even" << endl;
                exit(0);
            }
        }
    }
    ll t = sqrt(c);
    for (int i = -10000; i < 10000; i++) {
        if ((t + i) * (t + i) == c) {
            cout << "Odd" << endl;
            exit(0);
        }
    }
    cout << "Even" << endl;

    return 0;
}
0