結果

問題 No.1113 二つの整数 / Two Integers
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-15 18:09:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 787 bytes
コンパイル時間 1,252 ms
コンパイル使用メモリ 122,840 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-15 18:09:05
合計ジャッジ時間 3,249 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,368 KB
testcase_01 AC 1 ms
4,372 KB
testcase_02 AC 1 ms
4,368 KB
testcase_03 AC 2 ms
4,372 KB
testcase_04 AC 1 ms
4,372 KB
testcase_05 AC 1 ms
4,368 KB
testcase_06 AC 2 ms
4,368 KB
testcase_07 AC 1 ms
4,368 KB
testcase_08 AC 1 ms
4,368 KB
testcase_09 AC 1 ms
4,368 KB
testcase_10 AC 1 ms
4,368 KB
testcase_11 AC 1 ms
4,368 KB
testcase_12 AC 1 ms
4,372 KB
testcase_13 AC 1 ms
4,372 KB
testcase_14 AC 1 ms
4,372 KB
testcase_15 AC 1 ms
4,368 KB
testcase_16 AC 2 ms
4,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cmath>
#include<ctime>
#include<iomanip>
#include<numeric>
#include<stack>
#include<queue>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<random>
using namespace std;
long long gcd(long long a,long long b)
{
	while(b)
	{
		a %= b;
		swap(a,b);
	}
	return a;
}
void solve()
{
	long long A,B;
	cin >> A >> B;
	long long G = gcd(A,B);
	long long ok = 1,ng = (long long)2e9;
	while(ng-ok > 1)
	{
		long long mid = (ok+ng)/2;
		if(mid*mid <= G) ok = mid;
		else ng = mid;
	}

	cout << (ok*ok == G ? "Odd":"Even") << endl;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
0