結果

問題 No.69 文字を自由に並び替え
ユーザー nanatutmcnanatutmc
提出日時 2019-09-28 00:44:38
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 28,788 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-25 08:42:22
合計ジャッジ時間 965 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,348 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
    3 | main() {
      | ^~~~

ソースコード

diff #

#include <stdio.h>

main() {
    char str1[10], str2[10];
    int count1[26], count2[26];
    
    scanf("%s", str1);
    scanf("%s", str2);
    
    for (int i=0; i<10; i++) {
        if (str1[i] == 0)
            break;
        count1[str1[i]-'a']++;
        count2[str2[i]-'a']++;
    }
    
    for (int i=0; i<26; i++) {
        if (count1[i] != count2[i]) {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
    
}
0