結果

問題 No.1113 二つの整数 / Two Integers
ユーザー 👑 horiesinitihoriesiniti
提出日時 2023-04-08 09:35:30
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 270 bytes
コンパイル時間 204 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,416 KB
最終ジャッジ日時 2024-04-14 08:31:12
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
12,160 KB
testcase_01 AC 87 ms
12,288 KB
testcase_02 AC 93 ms
12,288 KB
testcase_03 AC 115 ms
12,160 KB
testcase_04 WA -
testcase_05 AC 111 ms
12,288 KB
testcase_06 AC 87 ms
12,160 KB
testcase_07 AC 90 ms
12,160 KB
testcase_08 AC 86 ms
12,160 KB
testcase_09 WA -
testcase_10 AC 85 ms
12,160 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 89 ms
12,416 KB
testcase_15 AC 114 ms
12,160 KB
testcase_16 AC 87 ms
12,160 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def f(a)
d=2
d2=d**2
d3=d**3
ans=1
while d3<=a
	if a%d2==0 then
		c=3
		a/=d2
		while a%d==0
			a/=d
			c+=1
		end
		ans*=c
	end
	
	d+=1
	d2=d**2
	d3=d**3
end
if a>1 || ans%2==0 then
	puts "Even"
else
	puts "Odd"
end
end
a,b=gets.split(" ").map{|e| e.to_i}
f(a.gcd(b))

0