結果

問題 No.313 π
ユーザー uafr_csuafr_cs
提出日時 2015-12-06 00:12:04
言語 Java19
(openjdk 21)
結果
AC  
実行時間 283 ms / 5,000 ms
コード長 1,023 bytes
コンパイル時間 2,110 ms
コンパイル使用メモリ 79,172 KB
実行使用メモリ 61,304 KB
最終ジャッジ日時 2023-10-12 15:54:14
合計ジャッジ時間 12,629 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 260 ms
59,268 KB
testcase_01 AC 247 ms
59,232 KB
testcase_02 AC 259 ms
58,916 KB
testcase_03 AC 256 ms
59,288 KB
testcase_04 AC 250 ms
59,648 KB
testcase_05 AC 246 ms
61,304 KB
testcase_06 AC 256 ms
59,000 KB
testcase_07 AC 255 ms
59,208 KB
testcase_08 AC 262 ms
59,084 KB
testcase_09 AC 259 ms
59,308 KB
testcase_10 AC 261 ms
59,360 KB
testcase_11 AC 258 ms
59,260 KB
testcase_12 AC 257 ms
58,964 KB
testcase_13 AC 248 ms
59,220 KB
testcase_14 AC 258 ms
59,172 KB
testcase_15 AC 259 ms
59,428 KB
testcase_16 AC 245 ms
59,172 KB
testcase_17 AC 257 ms
59,832 KB
testcase_18 AC 283 ms
58,956 KB
testcase_19 AC 262 ms
59,148 KB
testcase_20 AC 260 ms
59,176 KB
testcase_21 AC 261 ms
59,356 KB
testcase_22 AC 248 ms
59,520 KB
testcase_23 AC 255 ms
59,492 KB
testcase_24 AC 246 ms
59,408 KB
testcase_25 AC 258 ms
59,264 KB
testcase_26 AC 258 ms
59,056 KB
testcase_27 AC 251 ms
58,908 KB
testcase_28 AC 260 ms
59,312 KB
testcase_29 AC 257 ms
59,532 KB
testcase_30 AC 255 ms
59,180 KB
testcase_31 AC 258 ms
58,680 KB
testcase_32 AC 257 ms
59,540 KB
testcase_33 AC 259 ms
59,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;

public class Main {
	
	static int[] counts = new int[]{
			20104,
			20063,
			19892,
			20011,
			19874,
			20199,
			19898,
			20163,
			19956,
			19841
	};
	
	public static int[] process(char[] inputs, boolean output){
		int[] arr = new int[10];
		for(final char ch : inputs){
			if(!Character.isDigit(ch)){ continue; }
			
			arr[Character.getNumericValue(ch)]++;
		}
		
		if(!output){ return arr; }
		
		
		for(final int a : arr){ System.out.println(a + ","); }
		
		return arr;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] input = sc.next().toCharArray();
		boolean debug = false;
		
		int[] arr = process(input, debug);
		
		
		int less = -1, more = -1;
		for(int i = 0; i < 10; i++){
			if(counts[i] < arr[i]){
				more = i;
			}else if(counts[i] > arr[i]){
				less = i;
			}
		}
		
		System.out.println(more + " " + less);
		
	}

}
0