結果

問題 No.509 塗りつぶしツール
ユーザー Mr.Fuku
提出日時 2018-08-16 17:44:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 290 bytes
コンパイル時間 571 ms
コンパイル使用メモリ 63,872 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-02 14:17:37
合計ジャッジ時間 1,642 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <iostream>
using namespace std;
int main(void){
    string s;
    cin>>s;
    int num[] = {1,0,0,0,1,0,1,0,2,1};
    int cnt = 0;
    for(int i=0;i<s.size();i++){
        cnt += num[s[i]-'0'];
    }
    printf("%d\n",min(cnt+1+s.size()*2,(cnt+1)*2+s.size()));
}
0