結果

問題 No.884 Eat and Add
ユーザー NagisaNagisa
提出日時 2019-09-13 22:54:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 352 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 83,160 KB
最終ジャッジ日時 2023-09-17 15:03:03
合計ジャッジ時間 2,029 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,468 KB
testcase_01 AC 71 ms
71,328 KB
testcase_02 AC 72 ms
71,264 KB
testcase_03 AC 93 ms
78,704 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 91 ms
76,776 KB
testcase_07 AC 86 ms
83,160 KB
testcase_08 AC 73 ms
71,464 KB
testcase_09 AC 74 ms
71,856 KB
testcase_10 AC 71 ms
71,192 KB
testcase_11 AC 71 ms
71,324 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def main():
    def input():
        return sys.stdin.readline()[:-1]
    N = input()
    ans = 0
    L = list(N.split("00"))
    for e in L:
        for k in range(len(e)):
            if e[k] == "1":
                ans += min(e[k:].count("1"),e[k:].count("0")+2)
                break
    print(ans)
if __name__ == '__main__':
    main()
0