結果

問題 No.910 素数部分列
ユーザー rlangevinrlangevin
提出日時 2023-01-27 21:04:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 1,000 ms
コード長 356 bytes
コンパイル時間 465 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 93,716 KB
最終ジャッジ日時 2023-09-10 15:05:02
合計ジャッジ時間 7,146 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,248 KB
testcase_01 AC 74 ms
71,436 KB
testcase_02 AC 70 ms
71,340 KB
testcase_03 AC 70 ms
71,220 KB
testcase_04 AC 71 ms
71,368 KB
testcase_05 AC 71 ms
71,224 KB
testcase_06 AC 71 ms
71,384 KB
testcase_07 AC 72 ms
71,208 KB
testcase_08 AC 73 ms
71,344 KB
testcase_09 AC 73 ms
71,040 KB
testcase_10 AC 76 ms
71,080 KB
testcase_11 AC 73 ms
71,244 KB
testcase_12 AC 71 ms
71,400 KB
testcase_13 AC 72 ms
71,212 KB
testcase_14 AC 72 ms
71,380 KB
testcase_15 AC 71 ms
71,292 KB
testcase_16 AC 71 ms
71,080 KB
testcase_17 AC 70 ms
71,064 KB
testcase_18 AC 72 ms
71,396 KB
testcase_19 AC 71 ms
71,220 KB
testcase_20 AC 71 ms
71,308 KB
testcase_21 AC 72 ms
71,260 KB
testcase_22 AC 70 ms
71,456 KB
testcase_23 AC 97 ms
93,084 KB
testcase_24 AC 97 ms
93,544 KB
testcase_25 AC 99 ms
93,188 KB
testcase_26 AC 97 ms
93,144 KB
testcase_27 AC 99 ms
93,400 KB
testcase_28 AC 98 ms
93,432 KB
testcase_29 AC 98 ms
93,348 KB
testcase_30 AC 98 ms
93,216 KB
testcase_31 AC 97 ms
93,028 KB
testcase_32 AC 98 ms
93,516 KB
testcase_33 AC 97 ms
93,452 KB
testcase_34 AC 98 ms
93,716 KB
testcase_35 AC 98 ms
93,528 KB
testcase_36 AC 101 ms
93,716 KB
testcase_37 AC 99 ms
93,452 KB
testcase_38 AC 102 ms
93,576 KB
testcase_39 AC 99 ms
93,628 KB
testcase_40 AC 100 ms
93,600 KB
testcase_41 AC 98 ms
93,356 KB
testcase_42 AC 99 ms
93,520 KB
testcase_43 AC 99 ms
93,440 KB
testcase_44 AC 100 ms
93,408 KB
testcase_45 AC 102 ms
93,436 KB
testcase_46 AC 104 ms
93,364 KB
testcase_47 AC 97 ms
93,348 KB
testcase_48 AC 94 ms
93,188 KB
testcase_49 AC 93 ms
93,108 KB
testcase_50 AC 94 ms
93,012 KB
testcase_51 AC 93 ms
93,084 KB
testcase_52 AC 95 ms
93,388 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(input())
S = list(map(int, S))
ans = S.count(3) + S.count(5) + S.count(7)
one = 0
nine = 0
for s in S:
    if s == 1:
        one += 1
    elif s == 9:
        if one:
            ans += 1
            one -= 1
        else:
            nine += 1
while nine >= 2 and one:
    ans += 1
    nine -= 2
    one -= 1
print(ans + one//2)
0