結果

問題 No.69 文字を自由に並び替え
ユーザー ReERishunReERishun
提出日時 2020-05-17 16:09:28
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 1,261 ms
コンパイル使用メモリ 29,204 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-26 00:32:23
合計ジャッジ時間 1,535 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 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 WA -
testcase_09 AC 1 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[10];
	char strB[10];
	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']++;

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

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