結果

問題 No.1592 Tenkei 90
ユーザー NASU41NASU41
提出日時 2021-05-08 00:36:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 772 bytes
コンパイル時間 2,600 ms
コンパイル使用メモリ 72,004 KB
実行使用メモリ 55,956 KB
最終ジャッジ日時 2023-09-14 06:50:44
合計ジャッジ時間 6,356 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,568 KB
testcase_01 AC 115 ms
55,712 KB
testcase_02 AC 119 ms
55,480 KB
testcase_03 AC 119 ms
55,944 KB
testcase_04 AC 119 ms
55,776 KB
testcase_05 AC 119 ms
55,668 KB
testcase_06 AC 119 ms
55,484 KB
testcase_07 AC 119 ms
55,956 KB
testcase_08 AC 121 ms
55,800 KB
testcase_09 AC 118 ms
55,824 KB
testcase_10 AC 117 ms
55,692 KB
testcase_11 AC 119 ms
55,744 KB
testcase_12 AC 117 ms
55,684 KB
testcase_13 AC 118 ms
55,492 KB
testcase_14 AC 118 ms
55,476 KB
testcase_15 AC 120 ms
55,644 KB
testcase_16 AC 117 ms
55,888 KB
testcase_17 AC 119 ms
55,640 KB
testcase_18 AC 118 ms
55,684 KB
testcase_19 AC 117 ms
55,480 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 = "kyoprotenkei90";

        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