結果

問題 No.509 塗りつぶしツール
ユーザー face4
提出日時 2018-05-05 09:48:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 794 ms
コンパイル使用メモリ 64,768 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 01:32:05
合計ジャッジ時間 1,562 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int n, circles = 0;
    cin >> n;
    int length = to_string(n).length();
    int A[10] = {1,0,0,0,1,0,1,0,2,1};

    for(int i = 0; i < length; i++){
        circles += A[n%10];
        n /= 10;
    }

    if(1+circles > length)  cout << length*2 + circles + 1 << endl;
    else                    cout << length + (circles + 1)*2 << endl;
    return 0;
}
0