結果

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

ソースコード

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;
    while (n) {
        holes+=hole[n%10];
        digit++;
        n/=10;
    }
    cout<<min(2*digit+holes+1,2*(holes+1)+digit)<<endl;
    return 0;
}
0