結果

問題 No.69 文字を自由に並び替え
ユーザー mosmos_21
提出日時 2016-10-05 22:23:55
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 21,120 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 13:34:57
合計ジャッジ時間 708 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |   scanf("%s%s",a,b);
      |   ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
int main(){
  char a[11],b[11];
  int c[26]={0},i=0;
  scanf("%s%s",a,b);
  while(a[i]!='\0')
    c[a[i++]-'a']++;
  while(i){
    if(!c[b[i]-'a']){
      printf("NO\n");
      return 0;
    }else{
      c[b[i]-'a']--;
    }
    i--;
  }
  printf("YES\n");
  return 0;
}
0