結果

問題 No.509 塗りつぶしツール
ユーザー r2en_
提出日時 2017-06-30 23:23:24
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 318 bytes
コンパイル時間 466 ms
コンパイル使用メモリ 65,664 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 21:28:58
合計ジャッジ時間 1,365 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int a[10] = {1,0,0,0,1,0,1,0,2,1};
    char x;
    int s = 0;
    int h = 0;
    while(1){
        x = getchar();
        if(x=='\n')break;
        s++;
        h+=a[x-'0'];
    }
    cout << min(2*(h+1)+s,2*s+h+1) << endl;
    return 0;
}
0