結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー |
![]() |
提出日時 | 2020-07-17 21:36:08 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 1,000 ms |
コード長 | 738 bytes |
コンパイル時間 | 1,190 ms |
コンパイル使用メモリ | 90,308 KB |
最終ジャッジ日時 | 2025-01-11 22:20:20 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#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;}