結果

問題 No.509 塗りつぶしツール
ユーザー shinwisteriashinwisteria
提出日時 2017-05-04 21:18:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 3,413 ms
コンパイル使用メモリ 72,120 KB
実行使用メモリ 57,940 KB
最終ジャッジ日時 2023-10-12 08:09:36
合計ジャッジ時間 7,947 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,584 KB
testcase_01 AC 115 ms
55,360 KB
testcase_02 AC 117 ms
56,044 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 116 ms
55,600 KB
testcase_07 WA -
testcase_08 AC 116 ms
55,744 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 114 ms
56,212 KB
testcase_15 WA -
testcase_16 AC 114 ms
55,896 KB
testcase_17 WA -
testcase_18 AC 115 ms
55,648 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 115 ms
55,732 KB
testcase_23 AC 113 ms
56,116 KB
testcase_24 AC 113 ms
56,276 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 113 ms
55,840 KB
testcase_28 AC 113 ms
55,912 KB
testcase_29 AC 113 ms
55,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Nuritsubushi {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		StringBuilder n = new StringBuilder(s.next());
		s.close();
		int a = 0,b = 0,c = 0;
		while(n.length() != 0){
			char ch = n.charAt(0);
			n.deleteCharAt(0);
			if(ch == '8'){
				c++;
			}else if(ch == '0' || ch == '4' || ch == '6' || ch == '9'){
				b++;
			}else{
				a++;
			}
		}
		a = a*2 + b*3 + c*4 + 1;
		System.out.println(a);
	}

}
0