結果

問題 No.509 塗りつぶしツール
ユーザー Chomusuke
提出日時 2023-05-22 09:52:45
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 1,902 ms
コンパイル使用メモリ 172,760 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-22 04:54:13
合計ジャッジ時間 3,244 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
const set<int> ST = {0, 4, 6, 9};

int main() {

	string n;
	cin >> n;
	int sz = n.size();
	int ans = 0;
	ans += sz;
	ans++;
	for (int i = 0; i < sz; i++) {
		int cd = n[i] - '0';
		if (ST.count(cd)) ans++;
		else if (cd == 8) ans += 2;
	}
	ans += sz;
	cout << ans << endl;
	return (0);
}
0