結果

問題 No.509 塗りつぶしツール
ユーザー Naoyk1212
提出日時 2017-05-01 18:07:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 1,590 ms
コンパイル使用メモリ 160,516 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-14 01:57:22
合計ジャッジ時間 2,178 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

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

signed main(){
	string n;
	cin >> n;
	int v[10] = {4, 3, 3, 3, 4, 3, 4, 3, 5, 4};
	for(int i = 0; i < 10; i++)v[i] -= 3;

	long long count = 0;
	for(int i = 0; i < n.length(); i++){
		int a = n[i] - '0';
		count += v[a];
	}
	count = min(n.length() * 2 + count + 1, 2 * (count + 1) + n.length());
	cout << count << endl;
}
0