結果
問題 |
No.1113 二つの整数 / Two Integers
|
ユーザー |
|
提出日時 | 2020-07-17 21:44:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 2,829 bytes |
コンパイル時間 | 1,645 ms |
コンパイル使用メモリ | 167,068 KB |
実行使用メモリ | 10,496 KB |
最終ジャッジ日時 | 2024-11-29 22:56:19 |
合計ジャッジ時間 | 12,502 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 8 WA * 2 TLE * 5 |
ソースコード
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i,n) for (int i=0;i<(int)(n);i++) #define codefor int test;scanf("%d",&test);while(test--) #define yn(ans) cout<<(ans?"Yes":"No")<<endl #define YN(ans) cout<<(ans?"YES":"NO")<<endl #define umap unordered_map #define uset unordered_set using namespace std; using ll = long long; const int MOD=1000000007; //入力系 void scan(int& a){scanf("%d",&a);} void scan(long long& a){scanf("%lld",&a);} template<class T> void scan(T& a){cin>>a;} template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);} void in(){} template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);} //出力系 void print(const int& a){printf("%d",a);} void print(const long long& a){printf("%lld",a);} void print(const double& a){printf("%.15lf",a);} template<class T> void print(const T& a){cout<<a;} template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}} void out(){putchar('\n');} template<class T> void out(const T& t){print(t);putchar('\n');} template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);} //デバッグ系 template<class T> void dprint(const T& a){cerr<<a;} template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}} void debug(){cerr<<endl;} template<class T> void debug(const T& t){dprint(t);cerr<<endl;} template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);} int main(){ ll a,b; in(a,b); if(a==1||b==1){ out("Odd"); return 0; }else{ ll n=(ll)__gcd(a,b); ll ans=0; ll temp=0; if(n%2==0){ temp=0; while(n%2==0){ temp++; n/=2; } if(temp%2==1){ ans=1; goto skip; } } for(int i=3;i*i<=n;i+=4){ if(n%i==0){ temp=0; while(n%i==0){ temp++; n/=i; } if(temp%2==1){ ans=1; goto skip; } } i+=2; if(n%i==0){ temp=0; while(n%i==0){ temp++; n/=i; } if(temp%2==1){ ans=1; goto skip; } } } if(n!=1)ans=1; skip: cout<<(ans?"Even":"Odd")<<endl; } }