結果

問題 No.509 塗りつぶしツール
ユーザー kohaku_kohaku
提出日時 2017-04-28 23:03:03
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 556 bytes
コンパイル時間 2,523 ms
コンパイル使用メモリ 74,296 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2024-09-13 18:29:52
合計ジャッジ時間 8,059 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 2 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int ans = 2+S.length();
        for(int i=0; i<S.length(); i++){
            ans+=function(S,i);
        }
        System.out.println(ans);
    }
    static int function(String S, int k){
        char c = S.charAt(k);
        if(c=='8'){
            return 2;
        }else if(c=='0'||c=='4'||c=='6'||c=='9'){
            return 1;
        }else{
            return 0;
        }
    }
}
0