結果

問題 No.1592 Tenkei 90
ユーザー NASU41NASU41
提出日時 2021-05-08 00:41:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 812 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 72,656 KB
実行使用メモリ 55,748 KB
最終ジャッジ日時 2023-09-14 06:51:15
合計ジャッジ時間 5,526 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,452 KB
testcase_01 AC 119 ms
55,420 KB
testcase_02 AC 118 ms
55,664 KB
testcase_03 AC 120 ms
55,220 KB
testcase_04 AC 126 ms
55,228 KB
testcase_05 AC 121 ms
55,512 KB
testcase_06 AC 119 ms
55,708 KB
testcase_07 AC 121 ms
55,400 KB
testcase_08 AC 118 ms
55,620 KB
testcase_09 AC 116 ms
55,748 KB
testcase_10 AC 116 ms
55,596 KB
testcase_11 AC 117 ms
55,516 KB
testcase_12 AC 118 ms
55,452 KB
testcase_13 AC 118 ms
55,652 KB
testcase_14 AC 121 ms
55,508 KB
testcase_15 AC 118 ms
55,688 KB
testcase_16 AC 125 ms
55,320 KB
testcase_17 AC 119 ms
55,460 KB
testcase_18 AC 119 ms
55,448 KB
testcase_19 AC 119 ms
55,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    //各アルファベットの出現頻度をint[]の形で返す.
    private static int[] charCount(String s){
        int[] count = new int[128]; //ASCII文字は[0, 127]で表される
        for(int i=0; i<s.length(); i++){
            count[s.charAt(i)]++;
        }
        return count;
    }
    public static void main(String[] args) throws Exception{
        final Scanner sc = new Scanner(System.in);

        String S = sc.next();
        //Arrays::equalsは, 各要素の等価性を確認してくれる
        //自前でやるならforループが必要. charCount(S)==charCount("kyoprotenkei90") は不可
        if(Arrays.equals(charCount(S), charCount("kyoprotenkei90"))) System.out.println("Yes");
        else System.out.println("No");
    }
}
0