結果
問題 | No.1113 二つの整数 / Two Integers |
ユーザー | siman |
提出日時 | 2020-07-25 03:51:40 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 438 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 11,204 KB |
実行使用メモリ | 15,468 KB |
最終ジャッジ日時 | 2023-09-08 12:15:37 |
合計ジャッジ時間 | 6,724 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 95 ms
15,400 KB |
testcase_01 | AC | 95 ms
15,300 KB |
testcase_02 | AC | 953 ms
15,468 KB |
testcase_03 | AC | 791 ms
15,428 KB |
testcase_04 | AC | 786 ms
15,400 KB |
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
ソースコード
class Integer def divisor_list require 'prime' return [] if self <= 0 return [1] if self == 1 prime_division.map.with_index { |(base, k), i| s = i.zero? ? 0 : 1 (s..k).map { |n| base ** n } }.inject { |res, e| res + res.flat_map { |t| e.map { |v| t * v } } }.sort end end A, B = gets.split.map(&:to_i) res = A.divisor_list.count { |x| B % x == 0 } if res.even? puts 'Even' else puts 'Odd' end