結果
問題 |
No.717 ファッションへのこだわり
|
ユーザー |
![]() |
提出日時 | 2023-06-16 10:55:29 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 184 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-24 05:12:20 |
合計ジャッジ時間 | 843 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
ソースコード
#include <stdio.h> #include<string.h> int main() { int n,m; int ans=0; char s[10000]; int u[2]; int b[2]; memset(u,0,8); memset(b,0,8); scanf("%d%d",&n,&m); scanf("%s",&s); for (;n--;)s[n]=='A'?u[0]++:u[1]++; scanf("%s",&s); for (;m--;)s[m]=='A'?b[0]++:b[1]++; for (int i=2;i--;)u[i]>=b[i]?ans+=b[i]:(ans+=u[i]); printf("%d",ans); }