結果

問題 No.509 塗りつぶしツール
ユーザー tanimani364
提出日時 2021-03-29 17:21:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 230 ms
コンパイル使用メモリ 82,152 KB
実行使用メモリ 68,100 KB
最終ジャッジ日時 2024-11-29 10:08:38
合計ジャッジ時間 3,290 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
#coding:utf-8

import math
import string
import random
import heapq
from sys import stdin
# import numpy as np
# from matplotlib import pyplot as plt
	
def add(c):
	if c=='0':
		return 1
	elif c=='4':
		return 1
	elif c=='6':
		return 1
	elif c=='8':
		return 2
	elif c=='9':
		return 1
	else :
		return 0

def main():
	read=stdin.readline

	#edit here!
	s=read()
	n=len(s)
	n-=1
	ans=n*2+1
	for i in range(n):
		ans+=add(s[i])
	print(ans)

if __name__ == '__main__':
	main()
0