結果

問題 No.509 塗りつぶしツール
ユーザー r-yanyo
提出日時 2017-04-28 23:08:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 514 bytes
コンパイル時間 1,565 ms
コンパイル使用メモリ 168,220 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-13 18:30:42
合計ジャッジ時間 2,483 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

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

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

signed main(){
	// your code goes here
	int n = read();
	int hole = 0;
	string N = to_string(n);
	REP(i,N.length()){
		if(N[i] == '0' || N[i] == '4' || N[i] == '6' || N[i] == '9') hole += 1;
		else if(N[i] == '8') hole += 2;
	}
	if(hole==0) cout << N.length()+2;
	else cout << 2*N.length()+1+hole;
}
0