結果
問題 | No.717 ファッションへのこだわり |
ユーザー | subsn |
提出日時 | 2023-06-16 10:56:27 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 333 bytes |
コンパイル時間 | 231 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 05:13:10 |
合計ジャッジ時間 | 989 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
6,812 KB |
testcase_01 | AC | 1 ms
6,944 KB |
testcase_02 | AC | 1 ms
6,944 KB |
testcase_03 | AC | 1 ms
6,944 KB |
testcase_04 | AC | 1 ms
6,940 KB |
testcase_05 | AC | 1 ms
6,940 KB |
testcase_06 | AC | 1 ms
6,940 KB |
testcase_07 | AC | 1 ms
6,944 KB |
testcase_08 | AC | 1 ms
6,940 KB |
testcase_09 | AC | 1 ms
6,940 KB |
testcase_10 | AC | 1 ms
6,940 KB |
testcase_11 | AC | 1 ms
6,940 KB |
testcase_12 | AC | 1 ms
6,940 KB |
コンパイルメッセージ
main.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int] 1 | main(n,m,i,ans){ | ^~~~ main.c: In function 'main': main.c:1:1: warning: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: warning: type of 'ans' defaults to 'int' [-Wimplicit-int] main.c:6:5: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 6 | memset(u,0,8); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | main(n,m,i,ans){ main.c:6:5: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 6 | memset(u,0,8); | ^~~~~~ main.c:6:5: note: include '<string.h>' or provide a declaration of 'memset' main.c:8:5: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%d%d",&n,&m); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(n,m,i,ans){ main.c:8:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | scanf("%d%d",&n,&m); | ^~~~~ main.c:8:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:14:5: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 14 | printf("%d",ans); | ^~~~~~ main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
main(n,m,i,ans){ 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 (i=2;i--;)u[i]>=b[i]?ans+=b[i]:(ans+=u[i]); printf("%d",ans); }