結果

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

テストケース

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

ソースコード

diff #

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