結果
問題 |
No.1113 二つの整数 / Two Integers
|
ユーザー |
![]() |
提出日時 | 2020-07-17 21:42:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 602 bytes |
コンパイル時間 | 1,454 ms |
コンパイル使用メモリ | 167,036 KB |
実行使用メモリ | 13,640 KB |
最終ジャッジ日時 | 2024-11-29 22:45:28 |
合計ジャッジ時間 | 14,671 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 TLE * 6 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for(int i=0; i<(int)(n); i++) using namespace std; using ll = long long; using P = pair<int, int>; // a と b の最大公約数を返す関数 long long GCD(long long a, long long b) { if (b == 0) return a; else return GCD(b, a % b); } int main(){ ll a, b; cin >> a >> b; ll x = 0; ll c = GCD(a,b); for(ll i = 1; i * i <= c; i++){ if(c % i ==0){ x++; if(c/i != i) x++; } } string ans; if(x % 2 == 0) ans = "Even"; else ans = "Odd"; cout << ans << endl; return 0; }