結果

問題 No.910 素数部分列
ユーザー nep_pudding3nep_pudding3
提出日時 2019-10-18 23:36:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,552 KB
実行使用メモリ 8,628 KB
最終ジャッジ日時 2023-09-08 02:48:24
合計ジャッジ時間 4,947 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 15 ms
7,796 KB
testcase_02 AC 15 ms
7,788 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 15 ms
7,852 KB
testcase_06 AC 15 ms
7,808 KB
testcase_07 WA -
testcase_08 AC 15 ms
7,828 KB
testcase_09 AC 15 ms
7,856 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 15 ms
7,748 KB
testcase_14 WA -
testcase_15 AC 15 ms
7,824 KB
testcase_16 WA -
testcase_17 AC 14 ms
7,900 KB
testcase_18 WA -
testcase_19 AC 15 ms
7,860 KB
testcase_20 AC 16 ms
7,888 KB
testcase_21 WA -
testcase_22 AC 15 ms
7,828 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 83 ms
8,616 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 85 ms
8,608 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 90 ms
8,608 KB
testcase_35 AC 89 ms
8,580 KB
testcase_36 AC 90 ms
8,472 KB
testcase_37 AC 89 ms
8,412 KB
testcase_38 AC 89 ms
8,492 KB
testcase_39 AC 88 ms
8,596 KB
testcase_40 AC 87 ms
8,500 KB
testcase_41 AC 88 ms
8,552 KB
testcase_42 AC 86 ms
8,596 KB
testcase_43 AC 86 ms
8,488 KB
testcase_44 AC 87 ms
8,628 KB
testcase_45 AC 88 ms
8,544 KB
testcase_46 AC 90 ms
8,576 KB
testcase_47 AC 87 ms
8,468 KB
testcase_48 AC 78 ms
8,544 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 AC 83 ms
8,412 KB
testcase_52 AC 85 ms
8,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
ans = 0
nine = 0
one = 0
for i in range(N):
    c = S[i]
    if c in '357':
        ans += 1
    if c == '9':
        if one >= 1:
            one -= 1
            ans += 1
        else:
            nine += 1
    if c == '1':
        one += 1
nno = min(nine//2,one) 
ans += nno+min((one-nno)//2,0)
print(ans)

    
0