結果
問題 |
No.509 塗りつぶしツール
|
ユーザー |
![]() |
提出日時 | 2018-10-04 13:44:54 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 584 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-10-12 12:15:21 |
合計ジャッジ時間 | 2,010 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
#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+1 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()