結果

問題 No.313 π
ユーザー yasu_
提出日時 2019-04-03 01:04:11
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 885 bytes
コンパイル時間 3,662 ms
コンパイル使用メモリ 77,012 KB
実行使用メモリ 58,868 KB
最終ジャッジ日時 2024-12-14 17:26:22
合計ジャッジ時間 13,593 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

package programingtest;

import java.util.Scanner;

/**
 *
 * @author yh_04
 */
public class Programingtest {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int[] count = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
        int[] correct = {20104,20063,19892,20011,19874,20199,19898,20163,19956,19841}; 
        
        char[] s = new char[200010];
        
        Scanner sc = new Scanner(System.in);
        s = sc.next().toCharArray();
        
        for (int i = 0; i < s.length; i++) {
            count[s[i]]++;
        }
        
        int a = -1, b = -1;
        for (int i = 0; i < count.length; i++) {
            if (count[i] > correct[i]) {
                a = i;
            } else if (count[i] < correct[i]){
                b = i;
            }
        }
        System.out.println(a + " " + b);
    }
    
}
0