結果

問題 No.69 文字を自由に並び替え
ユーザー ReERishunReERishun
提出日時 2020-05-17 16:34:01
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 468 bytes
コンパイル時間 881 ms
コンパイル使用メモリ 28,832 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-26 01:06:18
合計ジャッジ時間 1,761 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<stdio.h>

int main() {
	
	char strA[11];
	char strB[11];
	int flg[26];
	int checkFlg = 0;

	scanf("%s", strA);
	scanf("%s", strB);

	for (int i = 0; i < 26; i++)
		flg[i] = 0;

	for (int i = 0; strA[i] != '\0'; i++) {
		flg[strA[i] - 'a']++;
		flg[strB[i] - 'a']--;
	}

	for (int i = 0; i < 26; i++) {
		if (flg[i] != 0) {
			checkFlg = 1;
			break;
		}
	}
	
	if(checkFlg == 0)
		printf("YES\n");
	else
		printf("NO\n");
	
	// 終了コードは0
	return 0;
}
0