結果
| 問題 | No.1113 二つの整数 / Two Integers |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2023-06-22 05:44:01 |
| 言語 | Ruby (4.0.1) |
| 結果 |
AC
|
| 実行時間 | 114 ms / 1,000 ms |
| コード長 | 354 bytes |
| 記録 | |
| コンパイル時間 | 370 ms |
| コンパイル使用メモリ | 8,960 KB |
| 実行使用メモリ | 15,104 KB |
| 最終ジャッジ日時 | 2026-03-19 02:03:45 |
| 合計ジャッジ時間 | 2,525 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
コンパイルメッセージ
Syntax OK
ソースコード
def f(n,l,r)
m=(l+r)/2
m2=m*m
if l==r then
return n==m2
else
return true if n==m2
if n<m2 then
return f(n,l,m)
else
return f(n,m+1,r)
end
end
end
a,b=gets.split(" ").map{|e| e.to_i}
c=a.gcd(b)
i=2
while c>=i**3 do
t=i**2
while c%t==0 do
c/=t
end
i+=1
end
c=1 if c>1 && f(c,2,c)
if c==1 then
puts "Odd"
else
puts "Even"
end
horiesiniti