結果

問題 No.69 文字を自由に並び替え
ユーザー Shirapon_ponShirapon_pon
提出日時 2021-05-15 00:10:46
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 739 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 29,952 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 05:21:24
合計ジャッジ時間 966 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

#define N 500000
#define LENGTH 10

int main(int argc, char *argv[]){
    char a[LENGTH+1];
    char b[LENGTH+1];
    int c[LENGTH+1] = {0};
    int d[LENGTH+1] = {0};
    int i,j,k;
    int tmp = 0;
    scanf("%s",a);
    scanf("%s",b);
    for(i=0; a[i]!='\0'; ++i);
    for (j = 0; j < i; j++)
    {
        for (k = 0; k < i; k++)
        {
            if (a[j] == b[k])
            {
                if (!c[j] && !d[k])
                {
                    c[j] = 1;
                    d[k] = 1;
                    tmp++;
                    continue;
                }
            }
        }
    }
    if (tmp == i)
    {
        printf("YES\n");
    } else
    {
        printf("NO\n");
    }
    return 0;
}
0