結果

問題 No.161 制限ジャンケン
ユーザー gigurururugigurururu
提出日時 2015-03-05 23:42:44
言語 Ruby
(3.3.0)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 11,212 KB
実行使用メモリ 15,340 KB
最終ジャッジ日時 2023-08-20 04:21:42
合計ジャッジ時間 3,355 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
15,068 KB
testcase_01 AC 76 ms
15,036 KB
testcase_02 AC 74 ms
15,072 KB
testcase_03 AC 74 ms
15,140 KB
testcase_04 AC 76 ms
15,140 KB
testcase_05 AC 78 ms
15,144 KB
testcase_06 AC 80 ms
15,340 KB
testcase_07 AC 78 ms
15,028 KB
testcase_08 AC 78 ms
15,124 KB
testcase_09 AC 78 ms
15,172 KB
testcase_10 AC 79 ms
15,144 KB
testcase_11 AC 78 ms
15,116 KB
testcase_12 AC 78 ms
15,308 KB
testcase_13 AC 79 ms
15,300 KB
testcase_14 AC 80 ms
15,032 KB
testcase_15 AC 80 ms
15,032 KB
testcase_16 AC 79 ms
15,144 KB
testcase_17 AC 79 ms
15,096 KB
testcase_18 AC 80 ms
15,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

y=gets.split.map(&:to_i)
z=%w(G C P).map{|i|(S||=gets).count(i)}
t=y.zip(z.rotate).map(&:min)
cnt=t.inject(:+)*3
y=y.zip(t).map{|i,j|i-j}
z=z.zip(t.rotate(2)).map{|i,j|i-j}
p cnt+y.zip(z).map(&:min).inject(:+)
0