結果

問題 No.1113 二つの整数 / Two Integers
ユーザー uw_yu1rabbituw_yu1rabbit
提出日時 2020-08-16 00:23:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
MLE  
実行時間 -
コード長 734 bytes
コンパイル時間 1,130 ms
コンパイル使用メモリ 102,456 KB
実行使用メモリ 814,488 KB
最終ジャッジ日時 2024-04-19 12:13:09
合計ジャッジ時間 4,671 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 246 ms
134,688 KB
testcase_03 AC 213 ms
135,568 KB
testcase_04 AC 212 ms
134,996 KB
testcase_05 MLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<numeric>
#include<set>
using namespace std;
using ll = long long;
vector<pair<ll, ll>> factrize(ll n)
{
    vector<pair<ll, ll>> res;
    for (ll i = 2; i <= sqrtl(n); i++)
    {
        ll k = i;
        ll cnt = 0;
        while (n % k == 0)
        {
            n /= k;
            cnt++;
        }
        res.emplace_back(k, cnt);
    }
    if (n != 1)
    {
        res.emplace_back(n, 1);
    }
    return res;
}
int main(){
    ll a,b;
    cin >> a >> b;
    ll g = gcd(a,b);
    vector<pair<ll,ll>> res = factrize(g);
    ll ans = 1;
    for(auto v:res){
        ans *= (v.second+1);
    }
    cout <<(ans % 2 == 0 ? "Even" : "Odd") << endl;
}
0