結果

問題 No.717 ファッションへのこだわり
ユーザー subsnsubsn
提出日時 2023-06-16 10:55:29
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 388 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 28,996 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-06 10:36:12
合計ジャッジ時間 1,093 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,384 KB
testcase_04 AC 0 ms
4,376 KB
testcase_05 AC 0 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 0 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 0 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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);
}
0