結果

問題 No.509 塗りつぶしツール
ユーザー fjafjafja
提出日時 2017-07-19 00:48:51
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 3,199 ms
コンパイル使用メモリ 74,864 KB
実行使用メモリ 51,936 KB
最終ジャッジ日時 2024-10-08 11:10:06
合計ジャッジ時間 5,943 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class N509
{
	public static void main(String[] args)throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String n=br.readLine();
		int total=1;
		for(int i=0;i<n.length();i++)
		{
			switch(Integer.parseInt(n.substring(i, i+1)))
			{
			case 1:
			case 2:
			case 3:
			case 5:
			case 7:
				total+=2;
				break;
			case 0:
			case 4:
			case 6:
			case 9:
				total+=3;
				break;
			case 8:
				total+=4;
				break;
			}
		}
		System.out.println(total);
	}

}
0