結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
|
提出日時 | 2017-12-25 18:58:07 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 309 bytes |
コンパイル時間 | 824 ms |
コンパイル使用メモリ | 98,496 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 23:16:30 |
合計ジャッジ時間 | 1,771 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto s = readln.chomp; auto n = s.map!(c => cast(int)(c-'0')).array; auto h = [1, 0, 0, 0, 1, 0, 1, 0, 2, 1]; auto o1 = 1 + h.indexed(n).sum; auto o2 = s.length.to!int; writeln(min(o1 + o2 + o1, o2 + o1 + o2)); }