結果

問題 No.1113 二つの整数 / Two Integers
ユーザー Manuel1024Manuel1024
提出日時 2022-01-11 20:10:52
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 585 bytes
コンパイル時間 503 ms
コンパイル使用メモリ 64,912 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-04-26 21:11:49
合計ジャッジ時間 3,134 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
using ll = long long;

ll mygcd(ll a, ll b){
    while(b != 0){
        int r = a%b;
        a = b;
        b = r;
    }
    return a;
}

int main(){
    ll a, b;
    cin >> a >> b;
    string ans = "Odd";
    ll g = mygcd(a, b);
    bool iseven = 0;
    for(ll i = 2, t = g; i*i <= g; i++){
        if(t%i == 0){
            int cnt = 0;
            while(t%i == 0){
                cnt++;
                t /= i;
            }
            if(cnt%2 == 1) ans = "Even";
        }
    }
    cout << ans << endl;
    return 0;
}
0