結果

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

ソースコード

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;
	}
	cout << 2*N.length()+1+hole;
}
0