結果

問題 No.69 文字を自由に並び替え
ユーザー ElkElk
提出日時 2018-05-26 15:11:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 25,404 KB
実行使用メモリ 5,060 KB
最終ジャッジ日時 2023-09-11 03:36:58
合計ジャッジ時間 1,762 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <string.h>

int main(){
    char str1[11], str2[11];
    int i, j, len, cnt = 0, flag[10] = {0};

    scanf("%s%s", str1, str2);
    len = strlen(str1);

    for(i = 0; i < len; i++){
        for(j = 0; j < len; j++){
            if(str1[i] == str2[j]){
                flag[j] = 1;
            }
        }
    }
    for(i = 0; i < len; i++){
        if(flag[i] == 1)    cnt++;
    }
    if(cnt == len){
        printf("YES\n");
    }else{
        printf("NO\n");
    }

    return 0;
}
0