結果

問題 No.717 ファッションへのこだわり
ユーザー tsuchinaga
提出日時 2019-02-27 21:49:37
言語 Go
(1.23.4)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 13,914 ms
コンパイル使用メモリ 224,384 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-06-23 05:19:42
合計ジャッジ時間 10,332 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"math"
	"strings"
)

func main() {
	var n, m int
	var s, t string
	_, _ = fmt.Scan(&n, &m, &s, &t)
	sa, sb := len(strings.Replace(s, "B", "", -1)), len(strings.Replace(s, "A", "", -1))
	ta, tb := len(strings.Replace(t, "B", "", -1)), len(strings.Replace(t, "A", "", -1))
	fmt.Println(int(math.Min(float64(sa), float64(ta)) + math.Min(float64(sb), float64(tb))))
}
0