結果
| 問題 | No.509 塗りつぶしツール |
| コンテスト | |
| ユーザー |
htensai
|
| 提出日時 | 2019-12-19 14:07:13 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 2,000 ms |
| コード長 | 521 bytes |
| 記録 | |
| コンパイル時間 | 1,730 ms |
| コンパイル使用メモリ | 82,056 KB |
| 実行使用メモリ | 39,104 KB |
| 最終ジャッジ日時 | 2026-03-28 15:16:46 |
| 合計ジャッジ時間 | 3,493 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 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 = 0;
for (char c : arr) {
total += counts[c - '0'];
}
System.out.println(Math.min(arr.length * 2 + total + 1, arr.length + (total + 1) * 2));
}
}
htensai