結果
| 問題 | No.1113 二つの整数 / Two Integers |
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2020-07-17 22:32:21 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 601 bytes |
| 記録 | |
| コンパイル時間 | 2,253 ms |
| コンパイル使用メモリ | 199,472 KB |
| 最終ジャッジ日時 | 2025-01-11 23:02:22 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 8 WA * 6 TLE * 1 |
ソースコード
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#include <bits/stdc++.h>
using namespace std;
int main() {
ll a,b;
cin>>a>>b;
ll m=gcd(a,b);
ll cnt2=0;
while(m>1 && m%2==0){
cnt2++;
m/=2;
}
if(cnt2%2==1){
cout<<"Even"<<endl;
return 0;
}
map<int,int> c;
for(ll i=3;i*i<=m;i+=2){
while(m>1 && m%i==0){
c[i]++;
m/=i;
}
}
bool flag=true;
for(auto x:c){
if(x.second%1==0) flag=false;
}
if(b) cout<<"Odd"<<endl;
else cout<<"Even"<<endl;
return 0;
}
umezo