結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2019-12-19 14:05:27 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 521 bytes |
コンパイル時間 | 1,766 ms |
コンパイル使用メモリ | 74,932 KB |
実行使用メモリ | 52,368 KB |
最終ジャッジ日時 | 2024-07-07 01:09:05 |
合計ジャッジ時間 | 3,981 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 27 |
ソースコード
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); char[] arr = br.readLine().toCharArray(); int[] counts = new int[]{1, 0, 0, 0, 1, 0, 1, 0, 2, 1}; long total = 1; for (char c : arr) { total += counts[c - '0']; } System.out.println(Math.min(arr.length * 2 + total + 1, arr.length + (total + 1) * 2)); } }