結果

問題 No.509 塗りつぶしツール
ユーザー r2en_
提出日時 2017-06-30 22:27:06
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 403 bytes
コンパイル時間 441 ms
コンパイル使用メモリ 66,628 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 19:34:39
合計ジャッジ時間 1,408 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
    int one_hole = 0;
    int two_hole = 0;
    int len = 0;
    string n;
    cin >> n;
    len = n.length();
    for(int i = 0; i < len; ++i){
        if(n[i]=='0' || n[i]=='4' || n[i]=='6' || n[i]=='9'){ one_hole+=1; }
        else if(n[i]=='8'){ two_hole+=1; }
    }
    cout << len * 2 + 1 + one_hole * 1 + two_hole * 2 << endl;
    return 0;
}
0