結果

問題 No.69 文字を自由に並び替え
ユーザー リチウムリチウム
提出日時 2014-11-19 01:50:44
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 355 bytes
コンパイル時間 2,131 ms
コンパイル使用メモリ 71,740 KB
実行使用メモリ 56,168 KB
最終ジャッジ日時 2023-08-20 22:28:28
合計ジャッジ時間 4,769 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,704 KB
testcase_01 AC 119 ms
55,636 KB
testcase_02 AC 119 ms
56,128 KB
testcase_03 AC 118 ms
55,844 KB
testcase_04 AC 119 ms
55,512 KB
testcase_05 AC 118 ms
55,440 KB
testcase_06 AC 119 ms
56,096 KB
testcase_07 AC 119 ms
55,692 KB
testcase_08 AC 119 ms
56,068 KB
testcase_09 AC 118 ms
56,168 KB
testcase_10 AC 118 ms
55,476 KB
testcase_11 AC 118 ms
55,868 KB
testcase_12 AC 119 ms
55,736 KB
testcase_13 AC 118 ms
55,800 KB
testcase_14 AC 117 ms
55,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		char a[]=sc.next().toCharArray();
		char b[]=sc.next().toCharArray();
		Arrays.sort(a);
		Arrays.sort(b);
		String s="YES";
		for(int i=0;i<a.length;i++){
			if(a[i]!=b[i])s="NO";
		}
		System.out.println(s);
		
	}}
0