結果
問題 |
No.1113 二つの整数 / Two Integers
|
ユーザー |
![]() |
提出日時 | 2020-07-17 22:13:15 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 693 bytes |
コンパイル時間 | 2,941 ms |
コンパイル使用メモリ | 192,716 KB |
最終ジャッジ日時 | 2025-01-11 22:47:49 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 TLE * 2 |
ソースコード
#include <bits/stdc++.h> #define rep(i, a) for (int i = (int)0; i < (int)a; ++i) using namespace std; using ll = long long; int main() { ll A, B; cin >> A >> B; ll X = gcd(A, B); ll result = 1; ll t = 0; while (X % 2 == 0) { t++; X /= 2; } result *= t + 1; for (ll i = 3; i < (ll)(sqrt(X) + 1); i += 2) { if (X % i != 0) continue; ll t = 0; while (X % i == 0) { t++; X /= i; } result *= t + 1; } if (X != 1) { result *= 2; } if (result % 2 == 0) { cout << "Even" << endl; } else { cout << "Odd" << endl; } return 0; }