結果
問題 | No.548 国士無双 |
ユーザー | subsn |
提出日時 | 2023-06-19 13:30:58 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 443 bytes |
コンパイル時間 | 217 ms |
コンパイル使用メモリ | 28,544 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 01:47:24 |
合計ジャッジ時間 | 1,226 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 1 ms
5,376 KB |
testcase_17 | AC | 1 ms
5,376 KB |
testcase_18 | AC | 1 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 1 ms
5,376 KB |
testcase_21 | AC | 0 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 1 ms
5,376 KB |
コンパイルメッセージ
main.c: In function 'main': main.c:7:9: warning: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 7 | memset(c, 0, sizeof(int) * 26); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | main.c:7:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 7 | memset(c, 0, sizeof(int) * 26); | ^~~~~~ main.c:7:9: note: include '<string.h>' or provide a declaration of 'memset' main.c:8:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 8 | scanf("%s",&s); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main.c:8:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 8 | scanf("%s",&s); | ^~~~~ main.c:8:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:15:33: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 15 | puts("Impossible"); | ^~~~ main.c:15:33: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:25:25: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 25 | printf("%c\n",i+97); | ^~~~~~ main.c:25:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:25:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:25:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:30:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 30 | printf("%c\n",i+97); |
ソースコード
int main() { char s[14]; int c[26]; int f = 0; memset(c, 0, sizeof(int) * 26); scanf("%s",&s); for (int i = 0;i < 13;i++) { c[(int)s[i] - 97]++; } for (int i = 0;i < 13;i++) { if (c[i] == 0) { if (f) { puts("Impossible"); return 0; } else { f++; } } } for (int i = 0;i < 13;i++) { if (c[i] == 0) { printf("%c\n",i+97); return 0; } } for (int i = 0;i < 13;i++) { printf("%c\n",i+97); } }