結果

問題 No.69 文字を自由に並び替え
ユーザー shallowshallow
提出日時 2017-09-08 12:25:20
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 450 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 27,492 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 23:48:42
合計ジャッジ時間 1,079 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
int main() {
  char A[10] = {'\0'}, B[10] = {'\0'};
  int i, j, count = 0;
  scanf("%s %s", A, B);
  //printf("A=%s B=%s\n", A, B);
  for (i = 0; A[i] != '\0'; i++) {
    for (j = 0; B[j] != '\0'; j++) {
      if (A[i] == B[j]) {
        count++;
        B[j] = '0';
        break;
      }
    }
  }
  //printf("count=%d i=%d\n", count, i);
  if (count == i) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
0