結果

問題 No.933 おまわりさんこいつです
ユーザー simansiman
提出日時 2020-09-10 07:51:54
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 221 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 11,188 KB
実行使用メモリ 26,948 KB
最終ジャッジ日時 2023-08-23 11:05:20
合計ジャッジ時間 5,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
15,044 KB
testcase_01 AC 82 ms
15,252 KB
testcase_02 AC 81 ms
15,152 KB
testcase_03 AC 80 ms
15,036 KB
testcase_04 AC 81 ms
15,148 KB
testcase_05 AC 81 ms
15,144 KB
testcase_06 AC 82 ms
15,156 KB
testcase_07 AC 82 ms
15,268 KB
testcase_08 AC 83 ms
15,160 KB
testcase_09 AC 83 ms
15,116 KB
testcase_10 AC 83 ms
15,116 KB
testcase_11 AC 84 ms
15,348 KB
testcase_12 AC 84 ms
15,228 KB
testcase_13 AC 87 ms
15,152 KB
testcase_14 AC 86 ms
15,188 KB
testcase_15 AC 89 ms
15,420 KB
testcase_16 AC 102 ms
17,192 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 139 ms
21,248 KB
testcase_21 AC 82 ms
15,120 KB
testcase_22 AC 83 ms
15,044 KB
testcase_23 AC 155 ms
26,876 KB
testcase_24 AC 153 ms
26,948 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
P = gets.split.map(&:to_i)
ans = 1

P.each do |x|
  if x == 0
    ans = 0
  elsif x % 9 == 0
    ans *= 9
  else
    ans *= x % 9
  end

  if ans % 9 == 0
    ans = 9
  else
    ans %= 9
  end
end

puts ans
0