結果

問題 No.1592 Tenkei 90
ユーザー NASU41NASU41
提出日時 2021-05-04 13:43:13
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 766 bytes
コンパイル時間 2,039 ms
コンパイル使用メモリ 72,180 KB
実行使用メモリ 56,836 KB
最終ジャッジ日時 2023-09-14 06:46:19
合計ジャッジ時間 5,619 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 116 ms
55,796 KB
testcase_06 AC 117 ms
55,828 KB
testcase_07 AC 115 ms
55,756 KB
testcase_08 AC 118 ms
55,428 KB
testcase_09 AC 115 ms
55,876 KB
testcase_10 AC 116 ms
55,804 KB
testcase_11 AC 115 ms
56,464 KB
testcase_12 AC 116 ms
55,896 KB
testcase_13 AC 116 ms
55,852 KB
testcase_14 AC 119 ms
55,812 KB
testcase_15 AC 115 ms
56,104 KB
testcase_16 AC 115 ms
55,908 KB
testcase_17 WA -
testcase_18 AC 120 ms
55,860 KB
testcase_19 AC 121 ms
55,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String target = "redcoder";

        char[] charInInput = new char[s.length()], charInTarget = new char[target.length()];
        for(int i=0; i<s.length(); i++) charInInput[i] = s.charAt(i);
        for(int i=0; i<target.length(); i++) charInTarget[i] = target.charAt(i);

        //「一方を並べ替えて他方にできるか?」⇔「両方をソートして一致するか?」
        Arrays.sort(charInInput);
        Arrays.sort(charInTarget);
        if(Arrays.equals(charInInput, charInTarget)) System.out.println("Yes");
        else System.out.println("No");
    }
}
0