結果
| 問題 | 
                            No.509 塗りつぶしツール
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-06-09 19:27:41 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 390 bytes | 
| コンパイル時間 | 1,605 ms | 
| コンパイル使用メモリ | 157,972 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-30 12:59:03 | 
| 合計ジャッジ時間 | 2,301 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 26 WA * 1 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,ans=0,ans2=0;
    cin >> n;
    if(n==0){ans+=2;}
    while(n!=0){
        ans++;ans2+=2;
        int tmp=n%10;
        if(tmp==0||tmp==4||tmp==6||tmp==9){ans+=2;ans2++;}
        if(tmp==8){ans+=4;ans2+=2;}
        n/=10;
    }
    if(ans+2<ans2+1) cout << ans+2 << endl;
    else cout << ans2+1 << endl;
    return 0;
}