結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー |
|
提出日時 | 2021-02-11 20:54:16 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 598 bytes |
コンパイル時間 | 1,463 ms |
コンパイル使用メモリ | 167,868 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-18 08:36:01 |
合計ジャッジ時間 | 2,194 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) template<class T> inline bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;} template<class T> inline bool chmin(T&a,T b){if(a>b){a=b;return 1;}return 0;} using ll = long long; ll a,b; ll gcd(ll a, ll b){return b ? gcd(b, a%b) : a;} bool issqrt(ll x){ ll ok=0, ng=2e9+5; while(ng-ok>1){ ll mid=(ok+ng)/2; (mid*mid<=x ? ok : ng)=mid; } return ok*ok==x; } int main () { cin.tie(0); ios::sync_with_stdio(false); cin >> a >> b; cout << (issqrt(gcd(a,b)) ? "Odd" : "Even") << endl; }