結果
| 問題 | No.1113 二つの整数 / Two Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-29 18:42:43 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 1,000 ms |
| + 320µs | |
| コード長 | 659 bytes |
| 記録 | |
| コンパイル時間 | 832 ms |
| コンパイル使用メモリ | 183,720 KB |
| 実行使用メモリ | 9,972 KB |
| 最終ジャッジ日時 | 2026-09-21 00:26:10 |
| 合計ジャッジ時間 | 2,506 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)
#define P pair<int, int>
ll gcd(ll a, ll b) {
return a%b ? gcd(b, a%b) : b;
}
bool isSquare(ll x) {
ll ac = 0, wa = 1e9+5;
while (wa-ac>1) {
ll wj = (wa+ac)/2;
if (wj*wj <= x) ac = wj;
else wa = wj;
}
ll wa2 = 0, ac2 = 1e9+5;
while (ac2-wa2>1) {
ll wj = (wa2+ac2)/2;
if (wj*wj >= x) ac2 = wj;
else wa2 = wj;
}
if (ac == ac2) return true;
else return false;
}
int main() {
ll a, b;
cin >> a >> b;
ll g = gcd(a,b);
if (isSquare(g)) cout << "Odd" << endl;
else cout << "Even" << endl;
}