結果
問題 | No.509 塗りつぶしツール |
ユーザー | kohaku_kohaku |
提出日時 | 2017-04-28 22:54:46 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 558 bytes |
コンパイル時間 | 3,809 ms |
コンパイル使用メモリ | 71,556 KB |
実行使用メモリ | 58,004 KB |
最終ジャッジ日時 | 2023-10-11 19:34:24 |
合計ジャッジ時間 | 8,679 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 119 ms
55,908 KB |
testcase_01 | AC | 119 ms
56,140 KB |
testcase_02 | AC | 120 ms
55,740 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 119 ms
55,624 KB |
testcase_07 | WA | - |
testcase_08 | AC | 118 ms
55,612 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 119 ms
55,604 KB |
testcase_15 | WA | - |
testcase_16 | AC | 120 ms
55,668 KB |
testcase_17 | WA | - |
testcase_18 | AC | 119 ms
56,008 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 121 ms
55,616 KB |
testcase_23 | AC | 118 ms
55,448 KB |
testcase_24 | AC | 119 ms
55,616 KB |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | AC | 119 ms
55,392 KB |
testcase_28 | AC | 118 ms
55,936 KB |
testcase_29 | AC | 120 ms
56,276 KB |
ソースコード
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; } } }