結果

問題 No.717 ファッションへのこだわり
ユーザー gemmarogemmaro
提出日時 2019-11-06 08:50:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 384 ms
コンパイル使用メモリ 11,368 KB
実行使用メモリ 16,196 KB
最終ジャッジ日時 2023-10-13 02:34:46
合計ジャッジ時間 2,488 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,176 KB
testcase_01 AC 81 ms
15,096 KB
testcase_02 AC 81 ms
15,140 KB
testcase_03 AC 81 ms
15,096 KB
testcase_04 AC 81 ms
15,028 KB
testcase_05 AC 80 ms
15,232 KB
testcase_06 AC 82 ms
15,288 KB
testcase_07 AC 86 ms
15,620 KB
testcase_08 AC 95 ms
16,196 KB
testcase_09 AC 95 ms
15,908 KB
testcase_10 AC 88 ms
15,352 KB
testcase_11 AC 89 ms
15,388 KB
testcase_12 AC 88 ms
15,504 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:1: warning: assigned but unused variable - n
Main.rb:1: warning: assigned but unused variable - m
Syntax OK

ソースコード

diff #

n, m = gets.chomp.split.map &:to_i
s = gets.chomp.chars.sort.group_by{|i| i }
t = gets.chomp.chars.sort.group_by{|i| i }

a = [ (s["A"] || []).size, (t["A"] || []).size ].min
b = [ (s["B"] || []).size, (t["B"] || []).size ].min

p a + b
0