結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-08 21:52:41 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 321 bytes |
| コンパイル時間 | 142 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-02 00:31:18 |
| 合計ジャッジ時間 | 997 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 15 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s %s", A, B);
| ^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main()
{
char A[11], B[11];
scanf("%s %s", A, B);
char a[26], b[26];
memset(a, 0, 26);
memset(b, 0, 26);
int n = strlen(A);
for (int i = 0; i < n; i++) {
a[A[i]-'a']++;
b[B[i]-'a']++;
}
if (memcmp(a, b, 26) == 0)
puts("YES");
else
puts("NO");
return 0;
}