結果

問題 No.1225 I hate I hate Matrix Construction
ユーザー yuruhiyayuruhiya
提出日時 2020-09-12 17:14:16
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 178 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 11,320 KB
実行使用メモリ 15,332 KB
最終ジャッジ日時 2023-08-30 16:19:49
合計ジャッジ時間 6,129 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,244 KB
testcase_01 AC 79 ms
15,104 KB
testcase_02 AC 78 ms
15,324 KB
testcase_03 AC 80 ms
15,276 KB
testcase_04 AC 79 ms
15,068 KB
testcase_05 AC 79 ms
15,068 KB
testcase_06 AC 80 ms
15,096 KB
testcase_07 AC 81 ms
15,064 KB
testcase_08 AC 79 ms
15,140 KB
testcase_09 AC 79 ms
15,264 KB
testcase_10 AC 80 ms
15,064 KB
testcase_11 AC 79 ms
15,012 KB
testcase_12 AC 79 ms
15,172 KB
testcase_13 AC 79 ms
15,092 KB
testcase_14 AC 80 ms
15,092 KB
testcase_15 AC 79 ms
15,328 KB
testcase_16 AC 80 ms
15,116 KB
testcase_17 AC 79 ms
15,152 KB
testcase_18 AC 80 ms
15,032 KB
testcase_19 AC 81 ms
15,128 KB
testcase_20 AC 80 ms
15,316 KB
testcase_21 AC 79 ms
15,268 KB
testcase_22 AC 81 ms
15,208 KB
testcase_23 AC 79 ms
15,076 KB
testcase_24 AC 80 ms
15,232 KB
testcase_25 AC 80 ms
15,156 KB
testcase_26 AC 80 ms
15,252 KB
testcase_27 WA -
testcase_28 AC 81 ms
15,104 KB
testcase_29 AC 80 ms
15,140 KB
testcase_30 AC 80 ms
15,148 KB
testcase_31 AC 80 ms
15,144 KB
testcase_32 AC 79 ms
15,332 KB
testcase_33 AC 79 ms
15,264 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i
s=[0,1].map{gets}
x,y=s.map{_1.count(?2)}
puts(if x>0&&y>0
	n*(x+y)-x-y
elsif x>0
	n*x+s[0].count(?1)
elsif y>0
	n*y+s[1].count(?1)
else
	s.map{_1.count(?1)}.max
end)
0