結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー |
![]() |
提出日時 | 2020-07-17 21:48:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,608 bytes |
コンパイル時間 | 964 ms |
コンパイル使用メモリ | 109,120 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 06:30:50 |
合計ジャッジ時間 | 1,410 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <cmath>#include <vector>#include <set>#include <map>#include <unordered_set>#include <unordered_map>#include <queue>#include <ctime>#include <cassert>#include <complex>#include <string>#include <cstring>#include <chrono>#include <random>#include <queue>#include <bitset>#include <stack>#include <functional>#ifdef LOCAL#define eprintf(...) fprintf(stderr, __VA_ARGS__)#else#define eprintf(...) 42#endif#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)#define all(x) (x).begin(), (x).end()template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }using namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair <int,int> P;typedef long double ld;int main (void){cin.tie(0);ios::sync_with_stdio(false);ll a, b, g; cin >> a >> b;g = gcd(a, b);ll ok = -1, ng = (ll)1e9 + 1;while (ng - ok > 1) {ll med = (ng + ok) / 2;if (med * med <= g) ok = med;else ng = med;}cout << (ok * ok == g ? "Odd\n" : "Even\n");return 0;}