結果

問題 No.69 文字を自由に並び替え
ユーザー mosmos_21
提出日時 2016-10-05 22:25:56
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 284 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 21,376 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 06:23:46
合計ジャッジ時間 731 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
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']==0){
      printf("NO\n");
      return 0;
    }else{
      c[b[i]-'a']--;
    }
  }
  printf("YES\n");
  return 0;
}
0