結果

問題 No.1113 二つの整数 / Two Integers
ユーザー harurunharurun
提出日時 2023-11-28 00:41:38
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 591 bytes
コンパイル時間 2,091 ms
コンパイル使用メモリ 201,264 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-11-28 00:41:44
合計ジャッジ時間 5,247 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 2 ms
6,548 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 2 ms
6,548 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;

#include <assert.h>

long long isqrt(long long n){
  assert(n>=0);
  if(n==0){
    return 0LL;
  }
  long long c=0,v=n;
  while(v>0){
    v>>=1;
    c++;
  }
  c--;
  c>>=1;
  long long a=1,d=0;
  for(long long s=0;s<c;s++){
    long long e=d;
    d=c>>s;
    a=(a << d-e-1)+(n >> 2*c-e-d+1)/a;
  }
  return a-(a*a>n);
}

ll gcd(ll x,ll y){
  if(!y)return x;
  return gcd(y,x%y);
}

int main(){
  ll A,B;
  cin>>A>>B;
  ll X=gcd(A,B);
  if(isqrt(X)*isqrt(X)==X){
    cout<<"Odd"<<endl;
  }else{
    cout<<"Even"<<endl;
  }
}
0