結果

問題 No.69 文字を自由に並び替え
ユーザー FpmpAmpmFpmpAmpm
提出日時 2016-10-22 16:07:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 118 ms / 5,000 ms
コード長 640 bytes
コンパイル時間 2,035 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 56,264 KB
最終ジャッジ日時 2023-08-20 23:30:25
合計ジャッジ時間 4,639 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,796 KB
testcase_01 AC 117 ms
55,972 KB
testcase_02 AC 116 ms
56,264 KB
testcase_03 AC 116 ms
55,956 KB
testcase_04 AC 117 ms
55,852 KB
testcase_05 AC 118 ms
56,000 KB
testcase_06 AC 115 ms
55,508 KB
testcase_07 AC 116 ms
55,792 KB
testcase_08 AC 115 ms
55,768 KB
testcase_09 AC 117 ms
56,160 KB
testcase_10 AC 117 ms
55,872 KB
testcase_11 AC 117 ms
56,112 KB
testcase_12 AC 118 ms
56,196 KB
testcase_13 AC 116 ms
55,792 KB
testcase_14 AC 116 ms
55,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
    	String A = sc.next();
    	char[] a = A.toCharArray();
    	String B = sc.next();
    	char[] b = B.toCharArray();
    	
    	Arrays.sort(a);
    	Arrays.sort(b);
    	
    	A = String.copyValueOf(a);
    	B = String.copyValueOf(b);
    	
    	System.out.println((A.equals(B)) ? "YES":"NO");
    	
	}
}
0