結果

問題 No.509 塗りつぶしツール
ユーザー OlderInvestor
提出日時 2017-10-30 20:58:19
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 602 bytes
コンパイル時間 3,634 ms
コンパイル使用メモリ 76,384 KB
実行使用メモリ 41,292 KB
最終ジャッジ日時 2024-11-22 10:55:23
合計ジャッジ時間 8,540 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;

public class No509 {
    public static void main(String[] args) {
        String n = new Scanner(System.in).next();
        char[] nC = n.toCharArray();
        HashSet<Character> more1 = new HashSet<>();
        int cnt;

        cnt = n.length() + 1;
        more1.addAll(Arrays.asList('0', '4', '6', '9'));

        for(char each : nC) {
            if( more1.contains(each) ) cnt++;
            if(each == '8') cnt += 2;
        }
        cnt += n.length();

        System.out.println(cnt);
    }
}
0