結果

問題 No.509 塗りつぶしツール
ユーザー htensai
提出日時 2019-11-17 19:26:06
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 2,164 ms
コンパイル使用メモリ 74,028 KB
実行使用メモリ 56,052 KB
最終ジャッジ日時 2024-09-25 06:03:25
合計ジャッジ時間 6,901 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
 	public static void main (String[] args) throws Exception {
 	    int[] counts = new int[]{3, 2, 2, 2, 3, 2, 3, 2, 4, 3};
		Scanner sc = new Scanner(System.in);
		char[] arr = sc.next().toCharArray();
		int total = 1;
		for (int i = 0; i < arr.length; i++) {
		    total += counts[arr[i] - '0'];
		}
		if (total == arr.length * 2 + 1) {
		    total = arr.length + 2;
		}
		System.out.println(total);
	}
}


0