結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
6,940 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
6,944 KB
testcase_14 AC 1 ms
6,944 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++;
                    printf("%d,%d\n",j+1,k+1);
                    continue;
                }
            }
        }
    }
    if (tmp == i)
    {
        printf("YES\n");
    } else
    {
        printf("NO\n");
    }
    return 0;
}
0