結果

問題 No.69 文字を自由に並び替え
ユーザー mits58mits58
提出日時 2016-07-02 12:14:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 484 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 72,512 KB
実行使用メモリ 56,128 KB
最終ジャッジ日時 2023-08-20 23:25:41
合計ジャッジ時間 4,983 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,880 KB
testcase_01 AC 121 ms
55,792 KB
testcase_02 AC 118 ms
55,760 KB
testcase_03 AC 116 ms
55,668 KB
testcase_04 AC 119 ms
55,952 KB
testcase_05 AC 117 ms
55,720 KB
testcase_06 AC 117 ms
55,584 KB
testcase_07 AC 117 ms
55,772 KB
testcase_08 AC 118 ms
56,128 KB
testcase_09 AC 120 ms
55,432 KB
testcase_10 AC 119 ms
55,792 KB
testcase_11 AC 119 ms
56,036 KB
testcase_12 AC 119 ms
55,776 KB
testcase_13 AC 119 ms
55,628 KB
testcase_14 AC 119 ms
56,056 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			char[] c1=(sc.next()).toCharArray();
			char[] c2=(sc.next()).toCharArray();
			Arrays.sort(c1); Arrays.sort(c2);
			boolean flag=true;
			for(int i=0;i<c1.length;i++){
				if(c1[i]!=c2[i]){
					System.out.println("NO");
					flag=false;
					break;
				}
			}
			if(flag) System.out.println("YES");
		}
	}
}
0