結果

問題 No.509 塗りつぶしツール
ユーザー kohaku_kohaku
提出日時 2017-04-28 22:54:46
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 558 bytes
コンパイル時間 2,010 ms
コンパイル使用メモリ 74,236 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2024-09-13 18:26:15
合計ジャッジ時間 6,697 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

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 = 1+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