結果

問題 No.2541 Divide 01 String
ユーザー ntudantuda
提出日時 2023-11-25 00:21:11
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 288 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 85,380 KB
最終ジャッジ日時 2023-11-25 00:21:16
合計ジャッジ時間 3,752 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 35 ms
53,460 KB
testcase_14 AC 35 ms
53,460 KB
testcase_15 AC 35 ms
53,460 KB
testcase_16 AC 37 ms
53,460 KB
testcase_17 AC 37 ms
53,460 KB
testcase_18 AC 43 ms
65,552 KB
testcase_19 AC 42 ms
65,544 KB
testcase_20 AC 42 ms
65,528 KB
testcase_21 AC 42 ms
62,992 KB
testcase_22 AC 42 ms
62,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
ans = 0
f = 0
for s in list(S):
    if f == 0:
        if s == "1":
            f = 1
            cnt = 1
            ans = 1
    elif f == 1:
        if s == "0":
            cnt += 1
        else:
            ans *= (cnt + 1)
            cnt = 1
print(ans)
0