結果

問題 No.933 おまわりさんこいつです
ユーザー wipexwipex
提出日時 2019-12-17 14:29:33
言語 Ruby
(3.3.0)
結果
AC  
実行時間 1,229 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 11,536 KB
実行使用メモリ 147,124 KB
最終ジャッジ日時 2023-09-15 19:36:49
合計ジャッジ時間 5,933 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,364 KB
testcase_01 AC 77 ms
15,100 KB
testcase_02 AC 78 ms
15,292 KB
testcase_03 AC 79 ms
15,160 KB
testcase_04 AC 78 ms
15,244 KB
testcase_05 AC 77 ms
15,052 KB
testcase_06 AC 78 ms
15,100 KB
testcase_07 AC 77 ms
15,236 KB
testcase_08 AC 79 ms
15,100 KB
testcase_09 AC 85 ms
15,252 KB
testcase_10 AC 79 ms
15,104 KB
testcase_11 AC 79 ms
15,104 KB
testcase_12 AC 80 ms
15,212 KB
testcase_13 AC 83 ms
16,084 KB
testcase_14 AC 86 ms
17,272 KB
testcase_15 AC 96 ms
23,504 KB
testcase_16 AC 204 ms
60,592 KB
testcase_17 AC 108 ms
22,436 KB
testcase_18 AC 80 ms
15,024 KB
testcase_19 AC 164 ms
48,640 KB
testcase_20 AC 607 ms
129,180 KB
testcase_21 AC 80 ms
15,116 KB
testcase_22 AC 79 ms
15,028 KB
testcase_23 AC 811 ms
126,696 KB
testcase_24 AC 1,229 ms
147,124 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

N = gets.to_i
p = gets.split(" ").map(&:to_i)

s = 1
p.each do |i|
  if i==0
    p 0
    exit
  else
    if i%9==0
      m=9
    else
      m=i%9
    end
    s*=m
  end
end

if s%9 ==0
  p 9
else
  p s%9
end
0