結果
| 問題 |
No.2415 偶数判定!Nafmoくん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-08-12 13:54:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 2,906 bytes |
| コンパイル時間 | 3,764 ms |
| コンパイル使用メモリ | 231,636 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-19 16:34:31 |
| 合計ジャッジ時間 | 4,163 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 |
ソースコード
/*
∧∧∩
( ゚∀゚)/ キタ━━━━━━(゚∀゚)━━━━━━!!!!
⊂ ノ ゆっくり見てってね!!!!!!!!
(つ ノ
o (ノ
\ ☆
| o
(⌒ ⌒ヽ / ☆
\ (´⌒ ⌒ ⌒ヾ /
('⌒ ; ⌒ ::⌒ )
(´ ) ::: ) /
☆─ (´⌒;: ::⌒`) :; )
*/
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
bool printb(bool f) {
if (f) cout << "Yes\n";
else cout << "No\n";
return f;
}
#define elif else if
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(a) a.begin(), a.end()
// xを2進数にした際にi桁目が0か1か
#define bit(x,i)((x>>i)&1)
typedef long long ll;
typedef long double ld;
ld pi = 3.14159265358979;
inline void scan(){}
template<class Head,class... Tail>
inline void scan(Head&head,Tail&... tail){std::cin>>head;scan(tail...);}
// print(a, b, c) => cout << a << ' ' << b << ' ' << c << endl;
inline void print(){}
template<class Head,class... Tail>
inline void print(Head&head,Tail&... tail){std::cout<<head<<" ";print(tail...);cout<<endl;}
//vectorのcout,cin
template<typename T>
std::istream &operator>>(std::istream&is,std::vector<T>&v){for(T &in:v){is>>in;}return is;}
template<typename T>
std::ostream &operator<<(std::ostream&os,const std::vector<T>&v){for(auto it=std::begin(v);it!=std::end(v);){os<<*it<<((++it)!=std::end(v)?" ":"");}return os;}
// 2地点の距離(long double)
long double coor_dist(long double xi, long double yi, long double xj, long double yj) {
return sqrt(abs((xi - xj) * (xi - xj)) + abs((yi - yj) * (yi - yj)));
}
// 回文かどうかの判定
bool iskaibun(string s){ll k = s.size();rep(i,0,k/2){if(s[i]!=s[k-1-i]){return false;}}return true;}
// 文字列(2進数表記)→10進数
ll binaryToDecimal(const std::string& binary) {
ll decimal = 0;
ll power = 1;
// 逆順に処理するため、文字列を反転させる
std::string reversedBinary(binary.rbegin(), binary.rend());
for (char bit : reversedBinary) {
if (bit == '1') {
decimal += power;
}
power *= 2;
}
return decimal;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
string a, b; cin >> a >> b;
bool ans = false;
if(binaryToDecimal(a)%2 == 0) ans = true;
if(binaryToDecimal(b)%2 == 0) ans = true;
if(ans) cout << "Even" << endl;
else cout << "Odd" << endl;
}