結果

問題 No.69 文字を自由に並び替え
ユーザー AQUA16573837
提出日時 2018-03-13 01:51:41
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 455 ms
コンパイル使用メモリ 37,188 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 06:59:37
合計ジャッジ時間 1,061 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~
main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |         scanf("%s", s);
      |         ~~~~~^~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <deque>
using namespace std;
using ll = long long;

//69
int main() {
	char s[11];
	int count[26] = { 0 };
	scanf("%s", s);
	for (int i = 0; s[i] != 0; i++)
		count[s[i] - 'a']++;
	scanf("%s", s);
	for (int i = 0; s[i] != 0; i++)
		count[s[i] - 'a']--;

	int match = 0;
	for (int i = 0; i < 26; i++)
		if (count[i] != 0)
			match++;
	printf("%s\n", match ? "NO" : "YES");
}
0