結果

問題 No.313 π
ユーザー 37zigen37zigen
提出日時 2016-03-07 03:19:36
言語 Java21
(openjdk 21)
結果
AC  
実行時間 275 ms / 5,000 ms
コード長 708 bytes
コンパイル時間 5,607 ms
コンパイル使用メモリ 76,604 KB
実行使用メモリ 61,552 KB
最終ジャッジ日時 2023-10-24 20:12:56
合計ジャッジ時間 12,180 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 256 ms
61,072 KB
testcase_01 AC 257 ms
60,992 KB
testcase_02 AC 241 ms
60,892 KB
testcase_03 AC 255 ms
61,024 KB
testcase_04 AC 245 ms
61,024 KB
testcase_05 AC 252 ms
61,040 KB
testcase_06 AC 256 ms
60,980 KB
testcase_07 AC 252 ms
61,048 KB
testcase_08 AC 260 ms
61,552 KB
testcase_09 AC 256 ms
60,392 KB
testcase_10 AC 256 ms
60,812 KB
testcase_11 AC 261 ms
61,188 KB
testcase_12 AC 242 ms
60,856 KB
testcase_13 AC 255 ms
61,056 KB
testcase_14 AC 275 ms
61,136 KB
testcase_15 AC 257 ms
60,948 KB
testcase_16 AC 245 ms
60,764 KB
testcase_17 AC 256 ms
61,092 KB
testcase_18 AC 267 ms
60,824 KB
testcase_19 AC 262 ms
61,304 KB
testcase_20 AC 257 ms
61,200 KB
testcase_21 AC 255 ms
60,784 KB
testcase_22 AC 247 ms
60,928 KB
testcase_23 AC 261 ms
61,296 KB
testcase_24 AC 256 ms
60,600 KB
testcase_25 AC 256 ms
60,832 KB
testcase_26 AC 257 ms
60,880 KB
testcase_27 AC 257 ms
60,880 KB
testcase_28 AC 255 ms
60,592 KB
testcase_29 AC 235 ms
60,756 KB
testcase_30 AC 257 ms
61,552 KB
testcase_31 AC 255 ms
61,048 KB
testcase_32 AC 255 ms
60,856 KB
testcase_33 AC 259 ms
60,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.PrintWriter;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		PrintWriter pw=new PrintWriter(System.out);
		Scanner sc=new Scanner(System.in);
		int[] num={20104,20063,19892,20011,19874,20199,19898,20163,19956,19841};

		String s=sc.next();
		char[] c=new char[s.length()];
		int cnt[]=new int[10];
		for(int i=0;i<s.length();i++){
			try{
				cnt[Character.getNumericValue(s.charAt(i))]++;
			}catch(Exception e){
			}
		}
		int wrong=0,correct=0;
		for(int i=0;i<10;i++){
			if(num[i]-1==cnt[i]){
				correct=i;
			}
			if(num[i]+1==cnt[i]){
				wrong=i;
			}
		}
		pw.println(wrong+" "+correct);

		sc.close();
		pw.close();
	}

}
0