結果

問題 No.509 塗りつぶしツール
ユーザー fjafjafjafjafjafja
提出日時 2017-07-19 00:48:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 608 bytes
コンパイル時間 3,867 ms
コンパイル使用メモリ 73,676 KB
実行使用メモリ 37,328 KB
最終ジャッジ日時 2024-04-17 02:06:02
合計ジャッジ時間 6,667 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
36,984 KB
testcase_01 AC 55 ms
37,148 KB
testcase_02 AC 54 ms
37,048 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 54 ms
37,028 KB
testcase_07 WA -
testcase_08 AC 53 ms
36,724 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 55 ms
36,956 KB
testcase_15 WA -
testcase_16 AC 55 ms
37,088 KB
testcase_17 WA -
testcase_18 AC 55 ms
36,900 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 56 ms
37,104 KB
testcase_23 AC 55 ms
36,936 KB
testcase_24 AC 56 ms
36,676 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 55 ms
37,008 KB
testcase_28 AC 55 ms
37,152 KB
testcase_29 AC 54 ms
36,932 KB
権限があれば一括ダウンロードができます

ソースコード

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