結果
| 問題 | No.69 文字を自由に並び替え | 
| コンテスト | |
| ユーザー |  suppy193 | 
| 提出日時 | 2015-05-28 15:54:11 | 
| 言語 | C90 (gcc 12.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 342 bytes | 
| コンパイル時間 | 145 ms | 
| コンパイル使用メモリ | 20,992 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-12-14 05:56:36 | 
| 合計ジャッジ時間 | 708 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 15 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%s", A);
      |         ^~~~~~~~~~~~~~
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s", B);
      |         ^~~~~~~~~~~~~~
            
            ソースコード
#include <stdio.h>
int main(void) {
	char A[11], B[11];
	int i, j, num_a[26] = {0}, num_b[26] = {0};
	scanf("%s", A);
	scanf("%s", B);
	i = 0;
	while(A[i] != '\0'){
		num_a[A[i] - 97]++;
		num_b[B[i] - 97]++;
		i++;
	}
	for(j = 0;j < 26;j++){
		if(num_a[j] != num_b[j]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES");
	
	return 0;
}
            
            
            
        