結果

問題 No.509 塗りつぶしツール
ユーザー akitsu818
提出日時 2017-04-28 23:18:26
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 2,121 ms
コンパイル使用メモリ 74,328 KB
実行使用メモリ 54,656 KB
最終ジャッジ日時 2024-09-13 18:33:43
合計ジャッジ時間 7,011 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

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=0;

		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;
			}
		}

		result = 2*count+1+zero_count;
		System.out.println(result);
	}
}
0