結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー |
![]() |
提出日時 | 2020-11-21 19:53:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,805 bytes |
コンパイル時間 | 1,554 ms |
コンパイル使用メモリ | 167,408 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 16:02:54 |
合計ジャッジ時間 | 2,431 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define rep(i, n) for (ll i = 0; i < n; ++i)#define P pair<ll, ll>#define Graph vector<vector<ll>>#define fi first#define se second#define vvvvll vector<vector<vector<vector<ll>>>>#define vvvll vector<vector<vector<ll>>>#define vvll vector<vector<ll>>#define vll vector<ll>#define pqll priority_queue<ll>#define pqllg priority_queue<ll, vector<ll>, greater<ll>>constexpr ll INF = (1ll << 60);constexpr ll mod = 1000000007; // 998244353;constexpr double pi = 3.14159265358979323846;template <typename T>inline bool chmax(T &a, T b) {if (a < b) {a = b;return 1;}return 0;}template <typename T>inline bool chmin(T &a, T b) {if (a > b) {a = b;return 1;}return 0;}void pt_vvll(vvll v) {ll vs = v.size(), vs0 = v[0].size();rep(i, vs) {rep(j, vs0) {cout << v[i][j];if (j != vs0 - 1)cout << " ";elsecout << "\n";}}}void pt_vll(vll v) {ll vs = v.size();rep(i, vs) {cout << v[i];if (i == vs - 1)cout << "\n";elsecout << " ";}}ll gcd(ll a, ll b) {if (a % b == 0) return b;return gcd(b, a % b);}//解説int main() {ios::sync_with_stdio(false);cin.tie(nullptr);ll A, B;cin >> A >> B;ll num = gcd(A, B);ll ok = 1, ng = 1e9 + 10;while (ng - ok > 1) {ll mid = (ok + ng) / 2;if (mid * mid <= num) {ok = mid;} else {ng = mid;}}// cout << ok << " " << num << "\n";if (ok * ok == num)cout << "Odd\n";elsecout << "Even\n";return 0;}