結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
Elk
|
| 提出日時 | 2018-05-26 15:11:47 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 515 bytes |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 23,424 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 18:10:20 |
| 合計ジャッジ時間 | 873 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s%s", str1, str2);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
int main(){
char str1[11], str2[11];
int i, j, len, cnt = 0, flag[10] = {0};
scanf("%s%s", str1, str2);
len = strlen(str1);
for(i = 0; i < len; i++){
for(j = 0; j < len; j++){
if(str1[i] == str2[j]){
flag[j] = 1;
}
}
}
for(i = 0; i < len; i++){
if(flag[i] == 1) cnt++;
}
if(cnt == len){
printf("YES\n");
}else{
printf("NO\n");
}
return 0;
}
Elk