結果
問題 |
No.69 文字を自由に並び替え
|
ユーザー |
![]() |
提出日時 | 2016-10-05 22:22:37 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 388 bytes |
コンパイル時間 | 515 ms |
コンパイル使用メモリ | 21,376 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 13:34:56 |
合計ジャッジ時間 | 721 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 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); | ^~~~~~~~~~~~~~~~~
ソースコード
#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'){ printf("%d %d\n", i, a[i]-'a'); c[a[i++]-'a']++; } int n; for(n = 0; n < 26;n++) printf("%d", c[n]); while(i){ if(!c[b[i]-'a']){ printf("NO\n"); return 0; }else{ c[b[i]-'a']--; } i--; } printf("YES\n"); return 0; }