結果

問題 No.1113 二つの整数 / Two Integers
ユーザー simansiman
提出日時 2020-07-25 03:46:35
言語 Ruby
(3.3.0)
結果
TLE  
実行時間 -
コード長 321 bytes
コンパイル時間 80 ms
コンパイル使用メモリ 11,408 KB
実行使用メモリ 19,908 KB
最終ジャッジ日時 2023-09-08 12:10:13
合計ジャッジ時間 7,950 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
19,908 KB
testcase_01 AC 93 ms
15,300 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

require 'prime'

A, B = gets.split.map(&:to_i)

a_div = A.prime_division
b_div = B.prime_division

counter = Hash.new(0)

a_div.each do |x, e|
  counter[x] += e
end

cnt = 1

b_div.each do |x, e|
  next if counter[x] == 0

  v = [counter[x], e].min

  cnt *= (v + 1)
end

if cnt.even?
  puts 'Even'
else
  puts 'Odd'
end
0