結果
問題 |
No.1113 二つの整数 / Two Integers
|
ユーザー |
|
提出日時 | 2020-08-16 21:10:13 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 643 bytes |
コンパイル時間 | 717 ms |
コンパイル使用メモリ | 79,812 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 10:42:02 |
合計ジャッジ時間 | 1,379 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 10 WA * 5 |
ソースコード
#include <string> #include <iostream> #include <algorithm> #include <math.h> #include <set> using namespace std; int gcd(long long a, long long b){ if (a%b == 0) return(b); else return(gcd(b, a%b)); } void solve(long long n) { long long max = sqrt(n)+1; set<long long> s; s.insert(n); for(long long i=1; i<=max; i++) { if(n%i==0) { s.insert(i); s.insert(n/i); } } if(s.size()%2==0) cout << "Even" << endl; else cout << "Odd" << endl; } int main() { long long a, b; cin >> a; cin >> b; //cout << gcd(a,b) << endl; solve(gcd(a,b)); return 0; }