結果

問題 No.509 塗りつぶしツール
ユーザー gma712gma712
提出日時 2018-10-04 13:39:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-12 12:15:17
合計ジャッジ時間 1,942 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 24 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding:utf-8

def main():
  num_list = []
  n = list(input())
  for i in n:
    num_list.append(replace(i))
  a, b, c = num_list.count('x'), num_list.count('y'), num_list.count('z')
  print(judge(a,b,c))


def replace(i):
  x_set = {'1','2','3','5','7',}
  y_set = {'0','4','6','9',}
  #z_set = {'5',}
  if i in x_set:
    return 'x'
  elif i in y_set:
    return 'y'
  else:
    return 'z'


def judge(a,b,c):
  return cal_1(a,b,c) if a < c else cal_2(a,b,c)


def cal_1(a,b,c):
  return a*2+b*3+c*4+1


def cal_2(a,b,c):
  return a+b*3+c*5+2


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