結果
| 問題 |
No.69 文字を自由に並び替え
|
| コンテスト | |
| ユーザー |
HEGO55
|
| 提出日時 | 2017-05-27 13:19:06 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 643 bytes |
| コンパイル時間 | 2,290 ms |
| コンパイル使用メモリ | 78,148 KB |
| 実行使用メモリ | 41,320 KB |
| 最終ジャッジ日時 | 2024-06-27 13:46:13 |
| 合計ジャッジ時間 | 4,459 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 1 |
ソースコード
import java.util.*;
class No69{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int count = 0;
String str1 = sc.next(); char[] c1 = str1.toCharArray();
String str2 = sc.next(); char[] c2 = str2.toCharArray();
if(c1.length == c2.length){
for(int i=0; i<str1.length(); i++){
for(int j=0; j<str2.length(); j++){
if(c1[i] == c2[j]){
c1[i] = '0';
continue;
}
}
}
}
for(int i=0; i<str1.length(); i++){
if(c1[i] == '0'){
count++;
}
}
if(count == str1.length()){
System.out.println("YES");
}else{
System.out.println("NO");
}
}
}
HEGO55