結果

問題 No.717 ファッションへのこだわり
ユーザー kyo1
提出日時 2020-12-05 05:23:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 364 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 198,660 KB
最終ジャッジ日時 2025-01-16 17:16:20
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, M;
  cin >> N >> M;
  string S, T;
  cin >> S >> T;
  map<char, int> mp;
  for (auto s : S) {
    mp[s]++;
  }
  int res = 0;
  for (auto t : T) {
    if (mp[t] > 0) {
      res++;
      mp[t]--;
    }
  }
  cout << res << '\n';
  return 0;
}
0