結果

問題 No.509 塗りつぶしツール
ユーザー Mcpu3Mcpu3
提出日時 2018-08-27 19:18:03
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 488 bytes
コンパイル時間 2,092 ms
コンパイル使用メモリ 74,136 KB
実行使用メモリ 41,480 KB
最終ジャッジ日時 2024-07-05 00:16:00
合計ジャッジ時間 7,238 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),s1=0,s2=2,t[]=new int[10];
		sc.close();
		do {
			s1++;
			s2++;
			t[n%10]++;
			n/=10;
		}while(n>0) ;
		s1*=2;
		s1++;
		s1+=t[0];
		s1+=t[4];
		s1+=t[6];
		s1+=t[8]*2;
		s1+=t[9];
		s2+=t[0]*2;
		s2+=t[4]*2;
		s2+=t[6]*2;
		s2+=t[8]*4;
		s2+=t[9]*2;
		if(s1>s2) System.out.print(s2);
		else System.out.print(s1);
	}
}
0