結果

問題 No.509 塗りつぶしツール
ユーザー akitsu818
提出日時 2017-04-29 00:15:42
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 2,097 ms
コンパイル使用メモリ 74,272 KB
実行使用メモリ 54,520 KB
最終ジャッジ日時 2024-09-13 18:53:10
合計ジャッジ時間 6,808 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	public static void main(String args[]){

		Scanner cin = new Scanner(System.in);

		String line = cin.next();
		int count = line.length();
		int zero_count = 0;
		char tmp;
		int result;

		for(int i=0;i<count;i++){
			tmp = line.charAt(i);
			if(tmp == '0'||tmp=='4'||tmp=='6'||tmp=='9'){
				zero_count++;
			}else if(tmp == '8'){
				zero_count+=2;
			}
		}
		if(zero_count>0){
			result = 2*count+1+zero_count;
		}else{
			result = 2+count;
		}
		System.out.println(result);
	}
}
0