結果

問題 No.509 塗りつぶしツール
ユーザー aaaaaaiu
提出日時 2019-08-17 23:51:31
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 1,931 ms
コンパイル使用メモリ 193,168 KB
最終ジャッジ日時 2025-01-07 13:55:54
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    int n;
    cin>>n;
    int hole[]={1,0,0,0,1,0,1,0,2,1};
    int holes=0;
    int digit=0;
    if (n==0) {
        holes++;
        digit++;
    }
    while (n) {
        holes+=hole[n%10];
        digit++;
        n/=10;
    }
    cout<<min(2*digit+holes+1,2*(holes+1)+digit)<<endl;
    return 0;
}
0