結果

問題 No.69 文字を自由に並び替え
コンテスト
ユーザー nanatutmc
提出日時 2019-09-28 00:41:55
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 450 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 54 ms
コンパイル使用メモリ 36,736 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-22 13:39:53
合計ジャッジ時間 1,225 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
    3 | main() {
      | ^~~~

ソースコード

diff #
raw source code

#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]]++;
        count2[str2[i]]++;
    }
    
    for (int i=0; i<26; i++) {
        if (count1[i] != count2[i]) {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
    
}
0